maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anders Hammar <and...@hammar.net>
Subject Re: Reg. accessing parent POM's property in child POM's version tag
Date Mon, 14 May 2012 12:54:28 GMT
What are you trying to accomplish? If you don't declare the version
element in a Maven project, Maven will use the version of the declared
parent as the version.
So, my suggestions is to have the versions hard-coded in the parent
section. The release plugin will update these when you release a
project, so you don't have to manage them manually.

/Anders

On Mon, May 14, 2012 at 2:42 PM, RAJIV_S <rajivbtech@gmail.com> wrote:
> I have a project structure like the below
>
> School-parent
>        |
>        |
>        |---- services-parent
>        |       |       |
>        |       |       |-Services-core
>        |       |               |
>        |       |               |---pom.xml
>        |       |
>        |       |---pom.xml
>        |
>        |----util-parent
>        |       |
>        |       |-common-util
>        |       |       |
>        |       |       |---pom.xml
>        |       |
>        |       |---pom.xml
>        |
>        |---pom.xml
>
>
> (1) school-parent's POM looks like below
>        <modelVersion>4.0.0</modelVersion>
>        <groupId>room</groupId>
>        <artifactId>School-parent</artifactId>
>        <version>0.0.1-SNAPSHOT</version>
>        <packaging>pom</packaging>
>          <properties>
>                <util-version>0.0.1-SNAPSHOT</util-version>
>                <services-parent>0.0.1-SNAPSHOT</services-parent>
>          </properties>
>          <modules>
>                 <module>services-parent</module>
>                  <module>util-parent</module>
>          </modules>
>
> (2) util-parent POM looks like
>        <modelVersion>4.0.0</modelVersion>
>        <parent>
>                <artifactId>School-parent</artifactId>
>                <groupId>room</groupId>
>                <version>0.0.1-SNAPSHOT</version>
>                <relativePath>../</relativePath>
>        </parent>
>        <groupId>room</groupId>
>        <artifactId>util-parent</artifactId>
>        <packaging>pom</packaging>
>        <version>${util-version}</version>
>        <modules>
>                <module>common-util</module>
>        </modules>
>
> (3) common-util POM looks like
>          <modelVersion>4.0.0</modelVersion>
>          <parent>
>            <artifactId>util-parent</artifactId>
>            <groupId>room</groupId>
>                <version>${util-version}</version>
>            <relativePath>../</relativePath>
>          </parent>
>          <groupId>room</groupId>
>          <artifactId>common-util</artifactId>
>        </project>
> (4) services - parent's POM looks like
>        <modelVersion>4.0.0</modelVersion>
>          <parent>
>            <artifactId>School-parent</artifactId>
>            <groupId>room</groupId>
>            <version>0.0.1-SNAPSHOT</version>
>            <relativePath>../</relativePath>
>          </parent>
>          <groupId>room</groupId>
>          <artifactId>services-parent</artifactId>
>          <packaging>pom</packaging>
>          <version>${services-parent}</version>
>          <modules>
>                <module>services-core</module>
>          </modules>
>
> (5) services-core's POM looks like
>        <parent>
>                <artifactId>services-parent</artifactId>
>                <groupId>room</groupId>
>                <version>${services-parent}</version>
>                <relativePath>../</relativePath>
>        </parent>
>        <groupId>room</groupId>
>        <artifactId>services-core</artifactId>
>        <dependencies>
>                <dependency>
>                        <groupId>room</groupId>
>                        <artifactId>common-util</artifactId>
>                        <version>${util-version}</version>
>                </dependency>
>        </dependencies>
>
>
>
> While running the root POM(No. 1), build success.
> But while running services parent individually , I am getting an build error
> saying it is not able to find common-util.
>
> Is the way i am accessing property value(${...}), inside version tag having
> any issue ?
> Or
> Any other issue ?
>
> Please help me to solve this issue, or give some suggestion on how can i
> overcome this problem.. ?
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/Reg-accessing-parent-POM-s-property-in-child-POM-s-version-tag-tp5708657.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message