How to configure scm in flat multi-module projects in maven?

I work with the following project structure

parent +-- pom.xml (parent and reactor) module-1 +-- pom.xml module-... +-- pom.xml 

I would like to be able to do mvn release:prepare in the parent project and have a final war as well as a consistent tag structure in svn.

Now everything works fine, with the exception of module tags, i.e. mvn release:prepare will mark the parent project, but not one of the child projects. I already found and tried the commitByProject switch in the parent-pom configuration. I entered and deleted scm configurations in moduel-poms, I tried to configure the release plugin in the-poms module all to no avail. The release phase never asks me for a tag for any of the modules and therefore does not create a tag later in the project.

How to configure parent and module so that mvn release:prepare tag modules?

+4
source share
2 answers

Further, countless hours of searching, which I no longer anticipate, can mark each module independently, using the maven release plugin.

I found (and lost) an explicit comment that this is not possible in the release plugin, and there are additional hints, for example, that the release plugin accepts only one scm tag in non-interactive mode.

Since I am a Java developer and not a maven developer, I refuse to change the structure of my package and thus get stuck in manual tagging.

+1
source

I would suggest reorganizing the structure to fit Maven best practices, for example:

 root (pom.xml; parent) +-- module-1 (pom.xml) +-- module-2 (pom.xml) +-- module-... 

This will simplify your life with Maven, and also make the release through the mvn release: prepare, etc.

I assume VCS has the following folder structure:

 root +-- parent (pom.xml) +-- module-1 (pom.xml) +-- module-2 (pom.xml) +-- module-... 

root is a folder that is issued from version control (trunk in SVN or master git).

If you gave the correct relative path to the parent element in these modules, everything should work without any problems. Configuring the scm part in the parent.

+2
source

Source: https://habr.com/ru/post/1432657/


All Articles