0

I have a project x with several modules, as usual in Maven, x-api, x-impl etc.

To keep things together, there is also a directory x-ear, which contains the EAR project, which will be deployed in the App Server. It's not part of the <modules> within the x POM, since it shouldn't take part in a normal reactor build. It does, however, have the same parent x.

Our release is done with the help of the versions-maven-plugin. Specifically, we create a new SNAPSHOT using

mvn versions:set -DnewVersion=1.2.0-SNAPSHOT -DgenerateBackupPoms=false

Everything works well for the project and its modules (note that the modules don't have a version of their own, they inherit it from the project parent).

But, of course, the x-ear is not updated, since it's not part of the reactor build.

I tried a cd into the directory and using versions.set or versions:update-parent, but they don't work.

Does anyone know the magic command? :-)

eerriicc
  • 1,124
  • 4
  • 17
  • 29
  • What happens if you `cd` into the directory and perform `mvn versions:set`? To my understanding this should work. – Andrew Logvinov Jun 14 '13 at 14:55
  • 2
    Sounds strange having the x-ear module being not part of the reactor? Which reason for that exist? What would you like to achieve ? Would you like to make your life easy ? Just put it into the modules list. – khmarbaise Jun 14 '13 at 15:22
  • `versions:update-parent` has always worked for me. If you want to grab the latest snapshot then you need to add `-DallowSnapshots=true` to the command line. – user944849 Jun 14 '13 at 21:11
  • @AndrewLogvinov: Since the EAR doesn't have a version of its own (it inherits from the parent), I get `[ERROR] Failed to execute goal org.codehaus.mojo:versions-maven-plugin:2.0:set (default-cli) on project payment-ear: Project version is inherited from parent. -> [Help 1]` – eerriicc Jun 17 '13 at 08:07
  • 1
    @user944849: It doesn't work within a reactor build, since the parent has not yet been installed in the repo. I tried `mvn versions:update-parent -DallowSnapshots=true -DparentVersion=1.5.0-SNAPSHOT -DgenerateBackupPoms=false` but I get the result `[INFO] Current version of xyz:x:pom:1.3.0-SNAPSHOT is the latest.` – eerriicc Jun 17 '13 at 08:09
  • @khmarbaise: Well, it makes the build a bit longer and I don't necessarily want to deploy the EAR to the repo. But I guess you're right, treating it as normal module would make my life easier. Thanks for pointing to a rather obvious solution :-) – eerriicc Jun 17 '13 at 08:20

1 Answers1

0

Thanks to khmarbaise for giving me the obvious answer: Just include the EAR as a normal module within the project.

eerriicc
  • 1,124
  • 4
  • 17
  • 29