Hello,

you are right, you have to specify the version of the parent, so you cannot
leave the version in one place only. But there are some mojos which help
managing the version. See versions-maven-plugin and release-maven-plugin.


Regards,
htfv (Aliaksei Lahachou)


On Fri, Aug 17, 2012 at 5:56 PM, Billy Newman <[email protected]> wrote:

> In Maven 2.
>
> I have a multi-module hierarchy and I would like the parent to be the
> only place that the version is defined.  However I do not think this
> is possible in maven 2.  If it is possible please let me know what I
> am doing wrong.
>
> Parent pom:
>
> <groupId>com.dummy</groupId>
> <artifactId>parent</artifactId>
> <version>1.0</version>
> <packaging>pom</packaging>
>
> Child pom:
>     <parent>
>         <groupId>com.dummy</groupId>
>         <artifactId>parent</artifactId>
> <!--
>         <version>1.0</version>
> -->
>     </parent>
>
>     <groupId>com.dummy</groupId>
>     <artifactId>kid</artifactId>
>
>
> Above example will not work as I have to set the version of my parent.
>  From what I have read I do not think that this is possible in maven
> 2, but I could have missed something.
>
> I think I can work around this by setting a property in the parent.  I
> am definitely all ears if there is a better way to accomplish this.
>
> Parent:
>
> <groupId>com.dummy<groupId>
> <artifactId>parent</artifactId>
> <version>${myversion}</version>
> <packaging>pom</packaging>
>
> <properties>
>   <myversion>1.0</myversion>
> </properties>
>
> Child pom:
>     <parent>
>         <groupId>com.dummy</groupId>
>         <artifactId>parent</artifactId>
>         <version>${myversion}/version>
>     </parent>
>
>     <groupId>com.dummy<groupId>
>     <artifactId>kid</artifactId>
>
>
> Thanks again for the help.
>
> Billy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to