Hi Curtis,
in Maven, the parent version can't be inherited because it need to
find the exact version, either in the project, in your local repo, or
from a remote repo. However if you just want your sub module to
inherit the version of the parent, simply leave the version of your
submodule out.
ie
1. in parent pom, set the coordinates as per normal and list the
submodules, or if you are using an existing pom that you don't want to
touch, skip this bit.
<groupId>org.jasig.portal.portlets-overlay</groupId>
<artifactId>uportal-portlets-overlay</artifactId>
<version>1.0-SNAPSHOT</version>
<modules>
<module>submodule</module>
</modules>
2. in sub module, create the parent block with all details filled in,
set your coords for this module but leave out the version tag for your
own module
<parent>
<groupId>org.jasig.portal.portlets-overlay</groupId>
<artifactId>uportal-portlets-overlay</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>org.jasig.portal.portlets-overlay</groupId>
<artifactId>uportal-portlets-overlay-submodule</artifactId>
For this submodule, the version will be inherited as 1.0-SNAPSHOT.
So when changing version numbers, at most you'll just need to change
the parent POM version (if you did step 1), and then the parent block
of every sub module (step 2).
cheers,
Steve
On 15/10/2009, at 2:40 AM, Curtis Garman wrote:
> Anyone know if there is an easy way to allow your portlet-overlay
> module pom.xml to inherit the portal version number as their version
> number? I would like to create a portlet-overlay that I could drop
> over uportal 3.1.1 but also over say 3.2.0 when it is
> released...instead of having to remember to go change on the 3.1.1
> version numbers. Would something like the following work?
>
> <parent>
> <groupId>org.jasig.portal.portlets-overlay</groupId>
> <artifactId>uportal-portlets-overlay-parent</artifactId>
> <version>${parent.version}</version>
> </parent>
>
> --
> Curtis Garman
> Web Programmer
> Heartland Community College
>
> ---
> You are currently subscribed to
[hidden email] as:
[hidden email]
> To unsubscribe, change settings or access archives, see
http://www.ja-sig.org/wiki/display/JSG/uportal-user---
You are currently subscribed to
[hidden email] as:
[hidden email]
To unsubscribe, change settings or access archives, see
http://www.ja-sig.org/wiki/display/JSG/uportal-user