Discussion:
Overriding the property value in child pom.xml
Arul Anand S P
2009-09-02 18:45:17 UTC
Permalink
hi all,

I am having a property named test.version in parent pom.xml

<properties>
<test.version>8</test.version>
</properties>

and I have a the below entry in child pom.xml
<dependencies>
<dependency>
<groupId>com.test.data</groupId>
<artifactId>UtilLibrary</artifactId>
<version>${test.version}</version>
</dependency>
</dependencies>

While executing the release:prepare from the command prompt I am over-riding
the value of the property test.version to 5
But the child pom.xml still takes the value 8 instead of 5 and is trying to
download the file UtilLibrary-8.jar instead of UtilLibrary-5.jar

Please help in resolving this
Jim Sellers
2009-09-03 15:22:50 UTC
Permalink
How are you overriding it? With
-Dtest.version=5
?

I'm assuming that you don't have that value in your settings.xml file.

Are you getting the correct dependency when you run:
mvn help:effective-pom -Dtest.version=5

Jim
Post by Arul Anand S P
hi all,
I am having a property named test.version in parent pom.xml
<properties>
<test.version>8</test.version>
</properties>
and I have a the below entry in child pom.xml
<dependencies>
<dependency>
<groupId>com.test.data</groupId>
<artifactId>UtilLibrary</artifactId>
<version>${test.version}</version>
</dependency>
</dependencies>
While executing the release:prepare from the command prompt I am over-riding
the value of the property test.version to 5
But the child pom.xml still takes the value 8 instead of 5 and is trying to
download the file UtilLibrary-8.jar instead of UtilLibrary-5.jar
Please help in resolving this
arulanand
2009-09-03 17:39:33 UTC
Permalink
I am overriding from the command prompt using -Dtest.version=5
Post by Jim Sellers
How are you overriding it? With
-Dtest.version=5
?
I'm assuming that you don't have that value in your settings.xml file.
mvn help:effective-pom -Dtest.version=5
Jim
On Wed, Sep 2, 2009 at 2:45 PM, Arul Anand S P
Post by Arul Anand S P
hi all,
I am having a property named test.version in parent pom.xml
<properties>
<test.version>8</test.version>
</properties>
and I have a the below entry in child pom.xml
<dependencies>
<dependency>
<groupId>com.test.data</groupId>
<artifactId>UtilLibrary</artifactId>
<version>${test.version}</version>
</dependency>
</dependencies>
While executing the release:prepare from the command prompt I am over-riding
the value of the property test.version to 5
But the child pom.xml still takes the value 8 instead of 5 and is trying to
download the file UtilLibrary-8.jar instead of UtilLibrary-5.jar
Please help in resolving this
--
View this message in context: http://www.nabble.com/Overriding-the-property-value-in-child-pom.xml-tp25271120p25280841.html
Sent from the Maven - Users mailing list archive at Nabble.com.
Brian Fox
2009-09-04 15:22:19 UTC
Permalink
The problem is that this version isn't being passed to the forked
execution of Maven that is actually performing the release. There is a
way to do that, I'll have to look it up, but generally you would be
better off with your source representing what you intend to release,
and only have the command line overrides for one-offs in development.
Otherwise your tag represents something other than what you released.
A big problem in my book...

Here's how you pass options to the forked build during perform:
http://maven.apache.org/plugins/maven-release-plugin/perform-mojo.html#arguments
Post by arulanand
I am overriding from the command prompt using -Dtest.version=5
How are you overriding it?  With
-Dtest.version=5
?
I'm assuming that you don't have that value in your settings.xml file.
mvn help:effective-pom -Dtest.version=5
Jim
On Wed, Sep 2, 2009 at 2:45 PM, Arul Anand S P
Post by Arul Anand S P
hi all,
I am having a property named test.version in parent pom.xml
 <properties>
   <test.version>8</test.version>
 </properties>
and I have a the below entry in child pom.xml
   <dependencies>
       <dependency>
           <groupId>com.test.data</groupId>
           <artifactId>UtilLibrary</artifactId>
           <version>${test.version}</version>
       </dependency>
 </dependencies>
While executing the release:prepare from the command prompt I am over-riding
the value of the property test.version to 5
But the child pom.xml still takes the value 8 instead of 5 and is trying to
download the file UtilLibrary-8.jar instead of UtilLibrary-5.jar
Please help in resolving this
--
View this message in context: http://www.nabble.com/Overriding-the-property-value-in-child-pom.xml-tp25271120p25280841.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
arulanand
2009-09-04 18:37:00 UTC
Permalink
Actually I am doing the same way by calling

mvn org.apache.maven.plugins:maven-release-plugin:2.0-beta-9:clean
org.apache.maven.plugins:maven-release-plugin:2.0-beta-9:prepare
-Dtest.version=5
org.apache.maven.plugins:maven-release-plugin:2.0-beta-9:perform
-DdryRun=true -Dtest.version=5

But it doesnot work
Post by Brian Fox
The problem is that this version isn't being passed to the forked
execution of Maven that is actually performing the release. There is a
way to do that, I'll have to look it up, but generally you would be
better off with your source representing what you intend to release,
and only have the command line overrides for one-offs in development.
Otherwise your tag represents something other than what you released.
A big problem in my book...
http://maven.apache.org/plugins/maven-release-plugin/perform-mojo.html#arguments
Post by arulanand
I am overriding from the command prompt using -Dtest.version=5
How are you overriding it?  With
-Dtest.version=5
?
I'm assuming that you don't have that value in your settings.xml file.
mvn help:effective-pom -Dtest.version=5
Jim
On Wed, Sep 2, 2009 at 2:45 PM, Arul Anand S P
Post by Arul Anand S P
hi all,
I am having a property named test.version in parent pom.xml
 <properties>
   <test.version>8</test.version>
 </properties>
and I have a the below entry in child pom.xml
   <dependencies>
       <dependency>
           <groupId>com.test.data</groupId>
           <artifactId>UtilLibrary</artifactId>
           <version>${test.version}</version>
       </dependency>
 </dependencies>
While executing the release:prepare from the command prompt I am over-riding
the value of the property test.version to 5
But the child pom.xml still takes the value 8 instead of 5 and is
trying
to
download the file UtilLibrary-8.jar instead of UtilLibrary-5.jar
Please help in resolving this
--
http://www.nabble.com/Overriding-the-property-value-in-child-pom.xml-tp25271120p25280841.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
---------------------------------------------------------------------
--
View this message in context: http://www.nabble.com/Overriding-the-property-value-in-child-pom.xml-tp25271120p25299605.html
Sent from the Maven - Users mailing list archive at Nabble.com.
arulanand
2009-09-04 18:58:27 UTC
Permalink
Actually I am doing the same way by calling

mvn org.apache.maven.plugins:maven-release-plugin:2.0-beta-9:clean
org.apache.maven.plugins:maven-release-plugin:2.0-beta-9:prepare
-Dtest.version=5
org.apache.maven.plugins:maven-release-plugin:2.0-beta-9:perform
-DdryRun=true -Dtest.version=5

But it doesnot work

Below is how my actual pom.xml look like

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>test</artifactId>
<groupId>com.test</groupId>
<version>2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<modelVersion>4.0.0</modelVersion>
<groupId>com.test.data</groupId>
<artifactId>DataManager</artifactId>
<name>Data Manager</name>
<version>2.1-SNAPSHOT</version>
<description />

<scm>
<url>http://<hostname>/test/trunk/DataManager</url>

<connection>scm:svn:https://<hostname>/test/trunk/DataManager</connection>

<developerConnection>scm:svn:https://<hostname>/test/trunk/DataManager</developerConnection>
</scm>

<dependencies>
<dependency>
<groupId>com.test.data</groupId>
<artifactId>UtilLib</artifactId>
<version>${test.version}</version>
</dependency>
</dependencies>
</project>

Parent pom.xml is given below

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>test</artifactId>
<packaging>pom</packaging>
<name>Test</name>
<version>2.1-SNAPSHOT</version>

<properties>
<test.version>1.0-SNAPSHOT</test.version>
</properties>

<modules>
<module>DataManager</module>
</modules>

<scm>
<url>http://<hostname>/test/trunk</url>
<connection>scm:svn:https://<hostname>/test/trunk</connection>

<developerConnection>scm:svn:https://<hostname>/test/trunk</developerConnection>
</scm>
</project>
Post by Brian Fox
The problem is that this version isn't being passed to the forked
execution of Maven that is actually performing the release. There is a
way to do that, I'll have to look it up, but generally you would be
better off with your source representing what you intend to release,
and only have the command line overrides for one-offs in development.
Otherwise your tag represents something other than what you released.
A big problem in my book...
http://maven.apache.org/plugins/maven-release-plugin/perform-mojo.html#arguments
Post by arulanand
I am overriding from the command prompt using -Dtest.version=5
How are you overriding it?  With
-Dtest.version=5
?
I'm assuming that you don't have that value in your settings.xml file.
mvn help:effective-pom -Dtest.version=5
Jim
On Wed, Sep 2, 2009 at 2:45 PM, Arul Anand S P
Post by Arul Anand S P
hi all,
I am having a property named test.version in parent pom.xml
 <properties>
   <test.version>8</test.version>
 </properties>
and I have a the below entry in child pom.xml
   <dependencies>
       <dependency>
           <groupId>com.test.data</groupId>
           <artifactId>UtilLibrary</artifactId>
           <version>${test.version}</version>
       </dependency>
 </dependencies>
While executing the release:prepare from the command prompt I am over-riding
the value of the property test.version to 5
But the child pom.xml still takes the value 8 instead of 5 and is
trying
to
download the file UtilLibrary-8.jar instead of UtilLibrary-5.jar
Please help in resolving this
--
http://www.nabble.com/Overriding-the-property-value-in-child-pom.xml-tp25271120p25280841.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
---------------------------------------------------------------------
--
View this message in context: http://www.nabble.com/Overriding-the-property-value-in-child-pom.xml-tp25271120p25299898.html
Sent from the Maven - Users mailing list archive at Nabble.com.
Matt Milliss
2009-09-10 11:10:37 UTC
Permalink
I work at a company that has around 10 applications, each application is
a maven project, each of which may or may not get modified in a given 2
week iteration. At the end of every iteration I want an automated
process for checking which applications have been modified since the
last release and then release only those applications. Something along
the lines of the following;

1. retrieve previous release version from our archiva repo
2. in subversion compare that versions tag against trunk to see any
differences
3. if any differences then perform a release of that project
4. repeat for each application

I've been trying to find a maven way of doing this but haven't had any
luck, has anybody done something similar with success.

Cheers
Matt Milliss
Thomas Sundberg
2009-09-11 04:58:31 UTC
Permalink
Hi!

It sounds as you need a CI server. It would solve your issue. Take a look at

CruiseControl:
http://cruisecontrol.sourceforge.net/

Hudson:
https://hudson.dev.java.net/

/Thomas
I work at a company that has around 10 applications, each application is a
maven project, each of which may or may not get modified in a given 2 week
iteration. At the end of every iteration I want an automated process for
checking which applications have been modified since the last release and
then release only those applications. Something along the lines of the
following;
1. retrieve previous release version from our archiva repo
2. in subversion compare that versions tag against trunk to see any
differences
3. if any differences then perform a release of that project
4. repeat for each application
I've been trying to find a maven way of doing this but haven't had any luck,
has anybody done something similar with success.
Cheers
Matt Milliss
---------------------------------------------------------------------
--
Thomas Sundberg
M. Sc. in Computer Science

Agical AB
Västerlånggatan 79, 2 tr
111 29 Stockholm, SWEDEN

Mobile: +46 70 767 33 15
E-mail: ***@agical.com
http://www.agical.com
Matt Milliss
2009-09-13 23:00:14 UTC
Permalink
Thanks Thomas,

we're using hudson as our CI server but I don't really understand how this
will solve my problem for me. We've got hudson setup to deploy snapshots to
our archiva repository on every svn commit and we're using
unique/timestamped snapshots, but not really sure how hudson can
automatically perform a release:prepare/perform step at a given point in
time ie every 2 weeks on only projects have changed since the last release.
Am I missing some feature that hudson supplies? Or am I just doing things
wrong all over the place?

Cheers
Matt

Thomas Sundberg wrote:

Hi!

It sounds as you need a CI server. It would solve your issue. Take a look at

CruiseControl:http://cruisecontrol.sourceforge.net/

Hudson:https://hudson.dev.java.net/

/Thomas

On Thu, Sep 10, 2009 at 13:10, Matt Milliss <***@gmail.com>
<***@gmail.com> wrote:


I work at a company that has around 10 applications, each application is a
maven project, each of which may or may not get modified in a given 2 week
iteration. At the end of every iteration I want an automated process for
checking which applications have been modified since the last release and
then release only those applications. Something along the lines of the
following;

1. retrieve previous release version from our archiva repo
2. in subversion compare that versions tag against trunk to see any
differences
3. if any differences then perform a release of that project
4. repeat for each application

I've been trying to find a maven way of doing this but haven't had any luck,
has anybody done something similar with success.

Cheers
Matt Milliss

---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@maven.apache.org
For additional commands, e-mail: users-***@maven.apache.org
Lewis, Eric
2009-09-14 06:43:56 UTC
Permalink
Well, if you have configured your jobs in Hudson to be built whenever something changes in your SCM, you could compare the current date to the latest build. This would answer the question whether a release is required.
As for releasing with Hudson, you might want to use the release plugin and start it with Hudson's CLI or wget. However, I don't think Hudson solves your specific requirements out-of-the-box (meaning: in an automated process). I think you would have to write a script which is then called every two weeks (e.g. with cron). But you would have to do that with Maven anyway.

Best regards,
Eric
-----Ursprüngliche Nachricht-----
Gesendet: Montag, 14. September 2009 01:00
An: Maven Users List
Betreff: Re: Automated release process
Thanks Thomas,
we're using hudson as our CI server but I don't really
understand how this
will solve my problem for me. We've got hudson setup to
deploy snapshots to
our archiva repository on every svn commit and we're using
unique/timestamped snapshots, but not really sure how hudson can
automatically perform a release:prepare/perform step at a
given point in
time ie every 2 weeks on only projects have changed since the
last release.
Am I missing some feature that hudson supplies? Or am I just
doing things
wrong all over the place?
Cheers
Matt
Hi!
It sounds as you need a CI server. It would solve your issue.
Take a look at
CruiseControl:http://cruisecontrol.sourceforge.net/
Hudson:https://hudson.dev.java.net/
/Thomas
I work at a company that has around 10 applications, each
application is a
maven project, each of which may or may not get modified in a
given 2 week
iteration. At the end of every iteration I want an automated
process for
checking which applications have been modified since the last
release and
then release only those applications. Something along the lines of the
following;
1. retrieve previous release version from our archiva repo
2. in subversion compare that versions tag against trunk to see any
differences
3. if any differences then perform a release of that project
4. repeat for each application
I've been trying to find a maven way of doing this but
haven't had any luck,
has anybody done something similar with success.
Cheers
Matt Milliss
---------------------------------------------------------------------
Matt Milliss
2009-09-15 06:00:38 UTC
Permalink
Thanks Eric,

I guess I'll write a script to do what I need. Any idea how I would
retrieve the latest non-snapshot release version from archiva.

Cheers
Matt
Post by Lewis, Eric
Well, if you have configured your jobs in Hudson to be built whenever something changes in your SCM, you could compare the current date to the latest build. This would answer the question whether a release is required.
As for releasing with Hudson, you might want to use the release plugin and start it with Hudson's CLI or wget. However, I don't think Hudson solves your specific requirements out-of-the-box (meaning: in an automated process). I think you would have to write a script which is then called every two weeks (e.g. with cron). But you would have to do that with Maven anyway.
Best regards,
Eric
-----Ursprüngliche Nachricht-----
Gesendet: Montag, 14. September 2009 01:00
An: Maven Users List
Betreff: Re: Automated release process
Thanks Thomas,
we're using hudson as our CI server but I don't really
understand how this
will solve my problem for me. We've got hudson setup to
deploy snapshots to
our archiva repository on every svn commit and we're using
unique/timestamped snapshots, but not really sure how hudson can
automatically perform a release:prepare/perform step at a
given point in
time ie every 2 weeks on only projects have changed since the
last release.
Am I missing some feature that hudson supplies? Or am I just
doing things
wrong all over the place?
Cheers
Matt
Hi!
It sounds as you need a CI server. It would solve your issue.
Take a look at
CruiseControl:http://cruisecontrol.sourceforge.net/
Hudson:https://hudson.dev.java.net/
/Thomas
I work at a company that has around 10 applications, each
application is a
maven project, each of which may or may not get modified in a
given 2 week
iteration. At the end of every iteration I want an automated
process for
checking which applications have been modified since the last
release and
then release only those applications. Something along the lines of the
following;
1. retrieve previous release version from our archiva repo
2. in subversion compare that versions tag against trunk to see any
differences
3. if any differences then perform a release of that project
4. repeat for each application
I've been trying to find a maven way of doing this but
haven't had any luck,
has anybody done something similar with success.
Cheers
Matt Milliss
---------------------------------------------------------------------
---------------------------------------------------------------------
Dan Tran
2009-09-15 06:33:46 UTC
Permalink
hook this command to hudson

mvn -B releaes:preprare release:perform

every 2 weeks

if there is no changes, hudson will not invoke it

-Dan
Post by Matt Milliss
Thanks Eric,
I guess I'll write a script to do what I need. Any idea how I would retrieve
the latest non-snapshot release version from archiva.
Cheers
Matt
Post by Lewis, Eric
Well, if you have configured your jobs in Hudson to be built whenever
something changes in your SCM, you could compare the current date to the
latest build. This would answer the question whether a release is required.
As for releasing with Hudson, you might want to use the release plugin and
start it with Hudson's CLI or wget. However, I don't think Hudson solves
your specific requirements out-of-the-box (meaning: in an automated
process). I think you would have to write a script which is then called
every two weeks (e.g. with cron). But you would have to do that with Maven
anyway.
Best regards,
Eric
-----Ursprüngliche Nachricht-----
Gesendet: Montag, 14. September 2009 01:00
An: Maven Users List
Betreff: Re: Automated release process
 Thanks Thomas,
we're using hudson as our CI server but I don't really
understand how this
will solve my problem for me. We've got hudson setup to
deploy snapshots to
our archiva repository on every svn commit and we're using
unique/timestamped snapshots, but not really sure how hudson can
automatically perform a release:prepare/perform step at a
given point in
time ie every 2 weeks on only projects have changed since the last release.
Am I missing some feature that hudson supplies? Or am I just
doing things
wrong all over the place?
Cheers
Matt
Hi!
It sounds as you need a CI server. It would solve your issue. Take a look at
CruiseControl:http://cruisecontrol.sourceforge.net/
Hudson:https://hudson.dev.java.net/
/Thomas
 I work at a company that has around 10 applications, each
application is a
maven project, each of which may or may not get modified in a given 2 week
iteration. At the end of every iteration I want an automated
process for
checking which applications have been modified since the last release and
then release only those applications. Something along the lines of the
following;
1. retrieve previous release version from our archiva repo
2. in subversion compare that versions tag against trunk to see any
differences
3. if any differences then perform a release of that project
4. repeat for each application
I've been trying to find a maven way of doing this but
haven't had any luck,
has anybody done something similar with success.
Cheers
Matt Milliss
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
Stephen Connolly
2009-09-15 06:33:48 UTC
Permalink
have you had a look at the versions-maven-plugin.... it might help
picking versions... or not!
Post by Matt Milliss
Thanks Eric,
I guess I'll write a script to do what I need. Any idea how I would retrieve
the latest non-snapshot release version from archiva.
Cheers
Matt
Post by Lewis, Eric
Well, if you have configured your jobs in Hudson to be built whenever
something changes in your SCM, you could compare the current date to the
latest build. This would answer the question whether a release is required.
As for releasing with Hudson, you might want to use the release plugin and
start it with Hudson's CLI or wget. However, I don't think Hudson solves
your specific requirements out-of-the-box (meaning: in an automated
process). I think you would have to write a script which is then called
every two weeks (e.g. with cron). But you would have to do that with Maven
anyway.
Best regards,
Eric
-----Ursprüngliche Nachricht-----
Gesendet: Montag, 14. September 2009 01:00
An: Maven Users List
Betreff: Re: Automated release process
 Thanks Thomas,
we're using hudson as our CI server but I don't really
understand how this
will solve my problem for me. We've got hudson setup to
deploy snapshots to
our archiva repository on every svn commit and we're using
unique/timestamped snapshots, but not really sure how hudson can
automatically perform a release:prepare/perform step at a
given point in
time ie every 2 weeks on only projects have changed since the last release.
Am I missing some feature that hudson supplies? Or am I just
doing things
wrong all over the place?
Cheers
Matt
Hi!
It sounds as you need a CI server. It would solve your issue. Take a look at
CruiseControl:http://cruisecontrol.sourceforge.net/
Hudson:https://hudson.dev.java.net/
/Thomas
 I work at a company that has around 10 applications, each
application is a
maven project, each of which may or may not get modified in a given 2 week
iteration. At the end of every iteration I want an automated
process for
checking which applications have been modified since the last release and
then release only those applications. Something along the lines of the
following;
1. retrieve previous release version from our archiva repo
2. in subversion compare that versions tag against trunk to see any
differences
3. if any differences then perform a release of that project
4. repeat for each application
I've been trying to find a maven way of doing this but
haven't had any luck,
has anybody done something similar with success.
Cheers
Matt Milliss
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
Loading...