I have a big multimodules project and I want to specify SCM infos to Maven. But, each one of the modules and the parent project have a dedicated folder on SVN, so it seems that SCM infos are specific to each module.
Which value I need to use for the connection and developerConnection elements? Do I need to configure SCM per module or it can be configured once in the parent project?
Thanks
Maven SCM supports Maven plugins (for example maven-release-plugin) and other tools by providing them with a common API for source code management operations. You can look at the list of SCMs for more information on using Maven SCM with your favorite SCM tool.
a maven module is like a maven "sub-project". a maven project includes 1 or more modules. more info here. Typically, a module generates a single artifact (jar, war, zip, etc), although this is not always true.
A multi-module project is built from an aggregator POM that manages a group of submodules. In most cases, the aggregator is located in the project's root directory and must have packaging of type pom. The submodules are regular Maven projects, and they can be built separately or through the aggregator POM.
Yes you can use Maven Profiles to manage this. Obviously you can tweak this approach to suit your needs however works best.
I tested two scenarios:
Defining the configuration only at the parent-pom level;
Defining the configuration at both the parent-pom and submodule level.
If you try mvn -DdryRun=true release:prepare
on your parent pom project, you will get a release.properties file that shows you the release configuration maven would have used if it had actually performed the prepare goal.
From there, you can see, when testing the first scenario that maven will not tag the child modules. You will only see one project.scm.[groupId]\:[artifactId].url
property.
Testing the second scenario, with scm configuration done also at the submodule level, you will get one property for each submodule.
My conclusion is that for flat multi-module project structure, you should define scm at both the parent-pom and module level, each one pointing to the scm directory where this pom is located.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With