Hi Stephen,
Have you already tested the solution you propose? I tried and it is not working
so I was wondering if there is something wrong in my use or if it is a plugin
bug.
My test case:
I have a property in my pom:
<test.prop.version>1.3</test.prop.version>
running mvn versions:update-properties the value is changed to
<test.prop.version>1.4</test.prop.version>
but when I put this configuration in the pom:
<properties>
...
<property>
<name>test.prop.version</name>
...
<version>[1.4]</version><!--Testing with a fixed value-->
...
</property>
...
</properties>
reverting to
<test.prop.version>1.3</test.prop.version>
and running mvn versions:update-properties the value is not changed. There is
no error but only:
Property ${test.prop.version}: Leaving unchanged as 1.3
Of course using a property instead of a fixed value in property configuration
doesn't work better.
Any idea?
Thanks
Julien
________________________________
De : Stephen Connolly <[email protected]>
À : Maven Users List <[email protected]>
Envoyé le : Jeu 22 Octobre 2009, 12 h 15 min 57 s
Objet : Re: Updating properties defined in pom from command line
you should be able to define a range to restrict updates to within a
range...
e.g. add a config section with a version restriction specified and have that
defined by a property
<project>
...
<build>
...
<plugins>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>1.0</version>
<configuration>
...
<properties>
...
<property>
<name>manchu.version</name>
...
<version>[${magic}]</version>
...
</property>
...
</properties>
...
</configuration>
</plugin>
...
</plugins>
...
</build>
...
</project>
then
mvn versions:updateProperties -Dmagic=newAVersion
2009/10/22 Julien HENRY <[email protected]>
> Hi,
>
> I'm working on a script that will automatically release many artifacts. For
> example I have 2 Maven projects (say A and B). B have a dependency on A. The
> dependency version is expressed using a property (say ${A.version}).
> In the SVN trunk, in B.pom, A.version=1-SNAPSHOT.
> A and B are independent Maven modules (not multi-module).
>
> Basically, the script is aware of the release order and will:
> - svn checkout A
> - mvn release:prepare release:perform -B -DreleaseVersion=1-RC1 (batch
> mode so release version was a parameter of the script)
> - svn checkout B
> - update A dependency in B.pom to 1-RC1
> - mvn release:prepare release:perform -B -DreleaseVersion=4-RC1
>
>
> My question is: how can I update A dependency in B.pom? I tried to use
> versions-maven-plugin but the plugin is too smart for my usage as it always
> try to update to the latest released version. What I want is to be able to
> say: "update property named A.version to value 1-RC1" even if A was already
> released in version 2.
>
> Do you know a way to do this?
>
> Thanks,
>
> Julien
>
>
>
>