AW: Using versions:set fails when the child version is inherited from its parent - why?
Ok, thanks for the clarification. I was hoping that the plugin would let me know that I'm trying to do something that can't be done (since the result would be identical to the existing POM). That is: Issue a warning instead of fail the build. But anyway: How could I find out myself whether the child has a version tag and whether it differs from its parent's version? Best regards, Eric P.S. Thanks for the plugin, it's a real life saver for us! -Ursprüngliche Nachricht- Von: Stephen Connolly [mailto:stephen.alan.conno...@gmail.com] Gesendet: Freitag, 15. Februar 2013 16:48 An: Maven Users List Betreff: Re: Using versions:set fails when the child version is inherited from its parent - why? version-maven-plugin assumes that if you don't provide /project/version and instead rely on /project/parent/version being the default value then *the child must always have the same version as the parent*. If the child may have a different version, then you specify the version. This behaves similarly with update-parent. if you specify a /project/version then, even if it is the same as /project/parent/version it will not be updated, but if you don't specify a /project/version then it will get updated. On 15 February 2013 15:37, Lewis, Eric wrote: > Hi > > I'm using the versions-maven-plugin during our semi-automated release > process to set a version. > > However, I have a problem whenever the version of the project is the same > as the one in the parent. > Maven 3 shows a warning if the versions are the same, but if I remove the > version (which seems reasonable), I get an error from the versions plugin: > > Failed to execute goal org.codehaus.mojo:versions-maven-plugin:1.3.1:set > (default-cli) on project external-versions: Project version is inherited > from parent. > > > Here's the POM I'm trying to modify: > > whatever > my-parent > 1.13.0-SNAPSHOT > > > > 4.0.0 > pom > external-versions > ... > > And I try to modify it with > mvn org.codehaus.mojo:versions-maven-plugin:1.3.1:set > -DnewVersion=1.13.0-SNAPSHOT > > > > If I create an identical version with > > whatever > my-parent > 1.13.0-SNAPSHOT > > > > 4.0.0 > pom > 1.13.0-SNAPSHOT > external-versions > > then it works. > > > > What am I doing wrong? > > (Yes, what I'm trying to do seems stupid, but I don't want to change the > command depending on whether the child inherits the version from its parent > or not - besides I don't know how I would find out whether it has its own > version or not. Also, sometimes the version is inherited from the parent > and sometimes not.) > > Best regards, > Eric > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Using versions:set fails when the child version is inherited from its parent - why?
version-maven-plugin assumes that if you don't provide /project/version and instead rely on /project/parent/version being the default value then *the child must always have the same version as the parent*. If the child may have a different version, then you specify the version. This behaves similarly with update-parent. if you specify a /project/version then, even if it is the same as /project/parent/version it will not be updated, but if you don't specify a /project/version then it will get updated. On 15 February 2013 15:37, Lewis, Eric wrote: > Hi > > I'm using the versions-maven-plugin during our semi-automated release > process to set a version. > > However, I have a problem whenever the version of the project is the same > as the one in the parent. > Maven 3 shows a warning if the versions are the same, but if I remove the > version (which seems reasonable), I get an error from the versions plugin: > > Failed to execute goal org.codehaus.mojo:versions-maven-plugin:1.3.1:set > (default-cli) on project external-versions: Project version is inherited > from parent. > > > Here's the POM I'm trying to modify: > > whatever > my-parent > 1.13.0-SNAPSHOT > > > > 4.0.0 > pom > external-versions > ... > > And I try to modify it with > mvn org.codehaus.mojo:versions-maven-plugin:1.3.1:set > -DnewVersion=1.13.0-SNAPSHOT > > > > If I create an identical version with > > whatever > my-parent > 1.13.0-SNAPSHOT > > > > 4.0.0 > pom > 1.13.0-SNAPSHOT > external-versions > > then it works. > > > > What am I doing wrong? > > (Yes, what I'm trying to do seems stupid, but I don't want to change the > command depending on whether the child inherits the version from its parent > or not - besides I don't know how I would find out whether it has its own > version or not. Also, sometimes the version is inherited from the parent > and sometimes not.) > > Best regards, > Eric > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > >
Using versions:set fails when the child version is inherited from its parent - why?
Hi I'm using the versions-maven-plugin during our semi-automated release process to set a version. However, I have a problem whenever the version of the project is the same as the one in the parent. Maven 3 shows a warning if the versions are the same, but if I remove the version (which seems reasonable), I get an error from the versions plugin: Failed to execute goal org.codehaus.mojo:versions-maven-plugin:1.3.1:set (default-cli) on project external-versions: Project version is inherited from parent. Here's the POM I'm trying to modify: whatever my-parent 1.13.0-SNAPSHOT 4.0.0 pom external-versions ... And I try to modify it with mvn org.codehaus.mojo:versions-maven-plugin:1.3.1:set -DnewVersion=1.13.0-SNAPSHOT If I create an identical version with whatever my-parent 1.13.0-SNAPSHOT 4.0.0 pom 1.13.0-SNAPSHOT external-versions then it works. What am I doing wrong? (Yes, what I'm trying to do seems stupid, but I don't want to change the command depending on whether the child inherits the version from its parent or not - besides I don't know how I would find out whether it has its own version or not. Also, sometimes the version is inherited from the parent and sometimes not.) Best regards, Eric - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org