3

I have a multi-module POM file:

...
<modules>
   <module>../project1</module>
   <module>../project2</module>
   <module>../project3</module>
   ...
</modules>
...

Each of the modules is itself a Maven project with its own POM. Inside each of these POMs I have the scm tag defined with the developerConnection specified like this:

<scm>
   <developerConnection>scm:svn:svn://hostname:port/path/to/trunk</developerConnection>
</scm>

My goal is to run the following Maven goals/options:

versions:update-parent versions:commit scm:checkin \
  -Dmessage="automated commit" -Dusername=user -Dpassword=pass

My expected results are:

  1. The parent of each module's POM is updated to the latest released version.
  2. The changes to each POM would be checked in to the SVN path specified in the POM for the module. E.g. project1 POM checked in using project1 <scm>/<developerConnection> path, project2 checked in using project2 path, etc.

Actual Results:

  1. The parent of each module's POM is updated to latest released version. This works as expected.
  2. Only the multi-module POM is checked in to SVN, none of the module POMs are checked in. This is the problem.

Is there a way to achieve the expected results above or is this something that the SCM plugin simply was not designed to do? If it is possible, how would I modify what I have in order to get the results I want?

Note: I can't change the project structure - I can't put the modules inside of the parent project, they have to remain separate.

Not sure if it's relevant but I'm using Maven 3.3.9.

Gerold Broser
  • 14,080
  • 5
  • 48
  • 107
D.B.
  • 4,523
  • 2
  • 19
  • 39
  • The chapter [Committing and updating changes through Maven](https://maven.apache.org/scm/maven-scm-plugin/usage.html#Committing_and_updating_changes_through_Maven) on the SCM plugin's Usage page mentions "**The files should be added beforehand by an external scm client.**". Did this happen? – Gerold Broser Jun 23 '16 at 17:42
  • Yes, the files already exist in SVN I'm just trying to commit changes to the files, not new files. – D.B. Jun 23 '16 at 21:37
  • Have you tried to run `scm:checkin -DworkingDirectory=../project` for each of your project directories? – Gerold Broser Jun 23 '16 at 22:09
  • I think that would check in the changes to each of the module projects, but I was hoping to be able to do that by using a single invocation of maven rather than having to run a second maven build to check in changes made by the first build. – D.B. Jun 24 '16 at 00:26

0 Answers0