You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by yeelong <cc...@yahoo.com> on 2015/01/15 08:02:56 UTC

Enquiry about POM parent tag version

Hi All,

    Could you please help to advise the following?

    I have the following in my parent POM 1:

	<profiles>		
		<profile>
			<id>development</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<repositories>
				<repository>
					<id>some-snapshots</id>
					<name>Some snapshots</name>			            
<url>http://someip:someport/content/repositories/snapshots/</url>
				</repository>
			</repositories>
		</profile>
                           <properties>
                                       
<currentVersion>version_A</currentVersion>
                           </properties>
	</profiles>


      I have the following in my children POM 2:

	<parent>
		<groupId>parent_group_id</groupId>
		<artifactId>parent_artifact_id</artifactId>
		<version>${currentVersion}</version>
	</parent>


       I have the following in my children POM 3:


		<dependency>
			<groupId>pom2_group_id</groupId>
			<artifactId>pom2_artifact_id</artifactId>
			<version>pom2_version</version>
		</dependency>


       POM1 and POM2 is both working fine and the ${currentVersion} is
recognized. But in POM 3, it complains that ${currentVersion} can not be
resolved.

Thanks and Regards,

Yee Long



--
View this message in context: http://maven.40175.n5.nabble.com/Enquiry-about-POM-parent-tag-version-tp5823587.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


Re: Enquiry about POM parent tag version

Posted by Ron Wheeler <rw...@artifact-software.com>.
What does your parent tag say in POM3?
Isn't that how current version is going to get resolved?
Maven will use what you tell it to find places where variables get 
resolved to values.


On 15/01/2015 2:02 AM, yeelong wrote:
> Hi All,
>
>      Could you please help to advise the following?
>
>      I have the following in my parent POM 1:
>
> 	<profiles>		
> 		<profile>
> 			<id>development</id>
> 			<activation>
> 				<activeByDefault>true</activeByDefault>
> 			</activation>
> 			<repositories>
> 				<repository>
> 					<id>some-snapshots</id>
> 					<name>Some snapshots</name>			
> <url>http://someip:someport/content/repositories/snapshots/</url>
> 				</repository>
> 			</repositories>
> 		</profile>
>                             <properties>
>                                         
> <currentVersion>version_A</currentVersion>
>                             </properties>
> 	</profiles>
>
>
>        I have the following in my children POM 2:
>
> 	<parent>
> 		<groupId>parent_group_id</groupId>
> 		<artifactId>parent_artifact_id</artifactId>
> 		<version>${currentVersion}</version>
> 	</parent>
>
>
>         I have the following in my children POM 3:
>
>
> 		<dependency>
> 			<groupId>pom2_group_id</groupId>
> 			<artifactId>pom2_artifact_id</artifactId>
> 			<version>pom2_version</version>
> 		</dependency>
>
>
>         POM1 and POM2 is both working fine and the ${currentVersion} is
> recognized. But in POM 3, it complains that ${currentVersion} can not be
> resolved.
>
> Thanks and Regards,
>
> Yee Long
>
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/Enquiry-about-POM-parent-tag-version-tp5823587.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
>
>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


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


Re: Enquiry about POM parent tag version

Posted by Stephen Connolly <st...@gmail.com>.
Please read my answer here:

http://stackoverflow.com/questions/14725197/reading-properties-file-from-pom-file-in-maven/14727072#14727072

I think you are trying to do something that does not work

On Thursday, 15 January 2015, Bernd <ec...@zusammenkunft.net> wrote:

> In order to help you we need the full chain, in pom3 you do not show the
> parent. In pom2 the current version must be defined, otherwise it cannot
> get to the parent.
>
> Did you check you actually get the pom versions you expect (just watch the
> downloads or look at help:effective-pom)
>
> Grettings
> Bernd
> Am 15.01.2015 08:04 schrieb "yeelong" <ccyyll8833@yahoo.com <javascript:;>
> >:
>
> > Hi All,
> >
> >     Could you please help to advise the following?
> >
> >     I have the following in my parent POM 1:
> >
> >         <profiles>
> >                 <profile>
> >                         <id>development</id>
> >                         <activation>
> >                                 <activeByDefault>true</activeByDefault>
> >                         </activation>
> >                         <repositories>
> >                                 <repository>
> >                                         <id>some-snapshots</id>
> >                                         <name>Some snapshots</name>
> > <url>http://someip:someport/content/repositories/snapshots/</url>
> >                                 </repository>
> >                         </repositories>
> >                 </profile>
> >                            <properties>
> >
> > <currentVersion>version_A</currentVersion>
> >                            </properties>
> >         </profiles>
> >
> >
> >       I have the following in my children POM 2:
> >
> >         <parent>
> >                 <groupId>parent_group_id</groupId>
> >                 <artifactId>parent_artifact_id</artifactId>
> >                 <version>${currentVersion}</version>
> >         </parent>
> >
> >
> >        I have the following in my children POM 3:
> >
> >
> >                 <dependency>
> >                         <groupId>pom2_group_id</groupId>
> >                         <artifactId>pom2_artifact_id</artifactId>
> >                         <version>pom2_version</version>
> >                 </dependency>
> >
> >
> >        POM1 and POM2 is both working fine and the ${currentVersion} is
> > recognized. But in POM 3, it complains that ${currentVersion} can not be
> > resolved.
> >
> > Thanks and Regards,
> >
> > Yee Long
> >
> >
> >
> > --
> > View this message in context:
> >
> http://maven.40175.n5.nabble.com/Enquiry-about-POM-parent-tag-version-tp5823587.html
> > Sent from the Maven - Users mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> <javascript:;>
> > For additional commands, e-mail: users-help@maven.apache.org
> <javascript:;>
> >
> >
>


-- 
Sent from my phone

Re: Enquiry about POM parent tag version

Posted by Adrien Rivard <ad...@gmail.com>.
Hi,

Don't put variables in parent tags.This can't work because project 2 can't
know which version of parent it should use so it can't resolve it and
neither the version declared in the parent.



On Fri, Jan 16, 2015 at 3:25 AM, yeelong <cc...@yahoo.com> wrote:

> Hi All,
>
>     Thanks for your advice.
>
>     POM3 is depending on POM2.
>
>     The following is POM3:
>
>
>                     <dependencies>
>                 <dependency>
>                         <groupId>pom2GroupId</groupId>
>                         <artifactId>pom2ArtifactId</artifactId>
>                         <version>pom2Version</version>
>                 </dependency>
>                      </dependencies>
>
>      Now, POM3 is ok. But, POM2 is having some issue. Initially POM2 is ok,
> but after built POM1 and POM2 and finally build POM3, POM2 complains that
> ${currentVersion} can not be resolved.
>
>
> Thanks and Regards,
>
> Yee Long
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Enquiry-about-POM-parent-tag-version-tp5823587p5823703.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
>
>


-- 
Adrien Rivard

Re: Enquiry about POM parent tag version

Posted by yeelong <cc...@yahoo.com>.
Hi All,

    Thanks for your advice.

    POM3 is depending on POM2.

    The following is POM3:


                    <dependencies>
		<dependency>
			<groupId>pom2GroupId</groupId>
			<artifactId>pom2ArtifactId</artifactId>
			<version>pom2Version</version>
		</dependency>
                     </dependencies>

     Now, POM3 is ok. But, POM2 is having some issue. Initially POM2 is ok,
but after built POM1 and POM2 and finally build POM3, POM2 complains that
${currentVersion} can not be resolved.


Thanks and Regards,

Yee Long



--
View this message in context: http://maven.40175.n5.nabble.com/Enquiry-about-POM-parent-tag-version-tp5823587p5823703.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


Re: Enquiry about POM parent tag version

Posted by yeelong <cc...@yahoo.com>.
hi Bernd,

    Thanks for your advice.

    The following is parent of POM3:


       <name>POM3 parent</name>


	<profiles>
		<profile>
			<id>someId</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<properties>
				<currentVersion>someVersionName</currentVersion>
			</properties>
		</profile>
	</profiles>

       In POM2, it seems the currentVersion can be resolved because it is
being retrieved from Parent POM1.

       Yes. In the local maven repository, the artifact is generated with
corresponding version.

Thanks and Regards,

Yee Long



--
View this message in context: http://maven.40175.n5.nabble.com/Enquiry-about-POM-parent-tag-version-tp5823587p5823702.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


Re: Enquiry about POM parent tag version

Posted by Bernd <ec...@zusammenkunft.net>.
In order to help you we need the full chain, in pom3 you do not show the
parent. In pom2 the current version must be defined, otherwise it cannot
get to the parent.

Did you check you actually get the pom versions you expect (just watch the
downloads or look at help:effective-pom)

Grettings
Bernd
Am 15.01.2015 08:04 schrieb "yeelong" <cc...@yahoo.com>:

> Hi All,
>
>     Could you please help to advise the following?
>
>     I have the following in my parent POM 1:
>
>         <profiles>
>                 <profile>
>                         <id>development</id>
>                         <activation>
>                                 <activeByDefault>true</activeByDefault>
>                         </activation>
>                         <repositories>
>                                 <repository>
>                                         <id>some-snapshots</id>
>                                         <name>Some snapshots</name>
> <url>http://someip:someport/content/repositories/snapshots/</url>
>                                 </repository>
>                         </repositories>
>                 </profile>
>                            <properties>
>
> <currentVersion>version_A</currentVersion>
>                            </properties>
>         </profiles>
>
>
>       I have the following in my children POM 2:
>
>         <parent>
>                 <groupId>parent_group_id</groupId>
>                 <artifactId>parent_artifact_id</artifactId>
>                 <version>${currentVersion}</version>
>         </parent>
>
>
>        I have the following in my children POM 3:
>
>
>                 <dependency>
>                         <groupId>pom2_group_id</groupId>
>                         <artifactId>pom2_artifact_id</artifactId>
>                         <version>pom2_version</version>
>                 </dependency>
>
>
>        POM1 and POM2 is both working fine and the ${currentVersion} is
> recognized. But in POM 3, it complains that ${currentVersion} can not be
> resolved.
>
> Thanks and Regards,
>
> Yee Long
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Enquiry-about-POM-parent-tag-version-tp5823587.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
>
>