0

we have a problem with maven releases and maven version plugin. In Jenkins we want to do releases automatically upon pressing a button. To remove snapshot dependencies we want to use the maven versions plugin. Suppose we have two projects A (latest release 0.0.1, latest snapshot 0.0.2-SNAPSHOT) and project B with a dependency on ProjectA - 0.0.2-SNAPSHOT and we want to release project B. How can we upgrade project Bs dependencies to the latest available release version? The maven versions plugin goal "use-releases" does not change the 0.0.2-SNAPSHOT dependency because there is no 0.0.2 release version of this project.

So my question is: how can we automatically remove snapshot dependencies and replace them with the latest available release version in our scenario?

lebrame57
  • 11
  • 4

1 Answers1

1

Using maven-release-plugin should be enough. There are two steps release:prepare and release:perform. When you do release:prepare settings those args developmentVersion and releaseVersion what would do the plugin is remove the SNAPSHOT for the current release (use releaseVersion) and then prepare for your next development iteration (use developmentVersion) and other things like commit in your SCM and tag the code.

For more information you can take a look maven-release-plugin docs.

Eddú Meléndez
  • 6,107
  • 1
  • 26
  • 35