Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Synchronizing artifact versions across platforms with maven release process

I have an artifact that should be built for several target platforms:

  • Linux x86
  • Windows x86
  • ARM11

Unfortunately due to the lack of crosscompilers, it is not possible to create all versions of the artifact in one go.

Using other words, the goal is to have in the repository something like this

  • artifact-1.0.0-linux.zip
  • artifact-1.0.0-windows.zip
  • artifact-1.0.0-arm11.zip
  • artifact-1.0.1-linux.zip
  • artifact-1.0.1-windows.zip
  • artifact-1.0.1-arm11.zip
  • ...

Note that the versions are in sync. How to accomplish this?

The thing is that the release process upgrades version of the pom.xml after every build. So by building consecutively on various platforms I can achieve having

  • artifact-1.0.0-linux.zip
  • artifact-1.0.1-windows.zip
  • artifact-1.0.2-arm11.zip
  • artifact-1.0.3-linux.zip
  • artifact-1.0.4-windows.zip
  • artifact-1.0.5-arm11.zip
  • ...

but this is not what I am looking for.

I could

  1. run on Linux

    mvn release:prepare release:perform -DpushChanges=false

    (with pushChanges set to false release won't increase version number in SCM)

  2. and then run on Windows

    mvn release:prepare release:perform

    (this will increase the version number)

But then the responsibility to trigger the release processes on various platforms in the proper order lies with me. Is there a way maven can help me with this?

Do you have any suggestions?

Thanks


PS. Note that this is not a question about how to organize into modules. It is about how to synchronize release processes of a single artifact on multiple platforms.

like image 273
Lukasz Guminski Avatar asked Apr 05 '12 12:04

Lukasz Guminski


1 Answers

Have you found a solution for this yet? It's good to know I'm not the only one fighting with Maven :-)

Anyway,

Are you allowed to deploy a released version to nexus? I'm thinking, you could do this:

1 - Do a "mvn release:prepare release:perform" from a windows machine - that should get artifact-1.0.1-windows.zip into nexus.

2 - Checkout the artifact-1.0.1 tag from source control

3 - Do a "mvn deploy" from linux and arm11 (whatever that is :P) - that should get -linux.zip and -arm11.zip into nexus as well.

Though, I believe that depending on how nexus is configured it won't let you redeploy anything with the same GAV (even if the classifier is different)

like image 114
Tony Lâmpada Avatar answered Oct 29 '22 13:10

Tony Lâmpada