multi-module-maven-release-plugin icon indicating copy to clipboard operation
multi-module-maven-release-plugin copied to clipboard

Release of all modules triggered by modules not referenced in parent / aggregator POM

Open manoswerts opened this issue 7 years ago • 1 comments

We have a multi module maven project that also contains a non-maven module for Vagrant configuration. It is therefore not mentioned in our parent / aggregator POM.

We noticed that making a change to that module causes the release build to release the whole project (all modules). It als happens for maven modules that are not referenced in the parent / aggregator POM.

I assume this isn't expected behaviour. Is their a property to prevent this from happening?

manoswerts avatar Feb 01 '18 15:02 manoswerts

For the ones encountering the same issue, we do have a workaround for this.

You need to reference all modules in the aggregator. If you have folders that aren't maven modules, you can create a dummy pom.xml file in those to be able to reference them in the aggregator. Then, when running the release command, you can exclude them from the build:

mvn releaser:release -pl \!moduleToIgnore1,\!moduleToIgnore2

This way, changes in those modules do not trigger a release of all other modules anymore.

Unfortunately, you cannot ignore modules that aren't referenced in the aggregator, so you cannot avoid doing that. You can, however, at them to a separate profile that you only active on your release build. That way you don't impact team members executing the complete builds locally.

manoswerts avatar Apr 09 '18 08:04 manoswerts