maven release plugin: how to skip releasing of submodule

226 views Asked by At

I have a multi-module project with one git-submodule, following structure

<modules>
   <module>common</module>
   <module>first</module>
   <module>second</module
</modules>

Module common is a git-submodule. During the release process, module common should not be released - meaning its version shall not change and it pom.xml shouldn't be modified. Other modules shall be released. I've tried a lot of configuration of maven release:prepare plugin but nothing works.

The only option which works is to pass -pl common to maven command line - but the problem is that this code is build by gitlab which is using common release procedure and it's not easy to pass it.

How can I "tell" the maven release plugin to simply ignore this module? Or maybe there's a possibility to pass command line argument -pl common via pom.xml?

Thanks

1

There are 1 answers

0
skillup On

You can use this plugin multi-module-maven-release-plugin:

A module is only released if there are changes to it !

Add the following to your plugins section:

<plugin>
    <groupId>com.github.danielflower.mavenplugins</groupId>
    <artifactId>multi-module-maven-release-plugin</artifactId>
    <version>3.6.4</version>
</plugin>

Release your project by running mvn releaser:release