Maven release: preparation overwrites SCM properties with allowed values

I suppose it's obvious, but I still think it's a flaw ...

I have 23 Mavenized projects. Now I add the <scm> bit because I started using the release plugin. Here is my thought process:

  • I will add a <scm> section only in my base POM company and parameterize URLs with properties, for example.
<scm> <connection>${scmBaseConnection}/${scm.module}/${scm.edition}</connection> <developerConnection>${scmBaseConnection}/${scm.module}/${scm.edition}</developerConnection> <url>${fisheyeBaseUrl}/${scm.module}</url> </scm> 
  • Then, each POM root project (aggregator) only needs to declare it scm. <properties> respectively (and no need to re-declare the entire <scm> section), for example:
  <scm.module>sharktopus</scm.module> <scm.edition>trunk</scm.edition> 

But I soon realized that I couldn’t do this: the release plugin overwrites each POM with the tag and the next versions of SCM information, so each such POM needs <scm> section.

Well, that’s why I decided to save the general SCM data in the basic properties of the POM, and each POM of the project should declare its own <scm> section using these details, as well as its own features, for example:

 <scm> <connection>${scmBaseConnection}/sharktopus/trunk</connection> <developerConnection>${scmBaseConnection}/sharktopus/trunk</developerConnection> <url>${fisheyeBaseUrl}/sharktopus</url> </scm> 

But this also does not work, because the release plugin is overwritten using the allowed values ​​(which is quite obvious in retrospect). So, for example, for the POM release tag, the information above would be rewritten as:

 <scm> <connection>scm:svn:https://mysvnhost.net/sharktopus/tags/R1_NewStuff</connection> <developerConnection>scm:svn:https://mysvnhost.net/sharktopus/tags/R1_NewStuff</developerConnection> <url>https://mysvnhost.net/sharktopus</url> </scm> 

This means that each POM must have its own <scm> with hardcoded URLs .

  • Is that what everyone does?
  • What happens if your SCM URLs change - are you just doing a search / replace on all your projects?
  • Could this be a feature request to the release plugin to rewrite partial URLs, for example. keep property references, but rewrite "final" features?
+4
source share
3 answers

The only place to define the scm part is the root of the project, not the root of the company. In a multi-module assembly, you need to have only one scm part. The reason the release plugin replaces properties is very simple. Upon release, these pom should represent this state for this software. If they had properties in it, it would be impossible to guarantee the values ​​of the corvette, etc. Thus, the result would not be reproducible ... If the SCM URL changes, it will be valid only for new projects, not for old ones, because they are already deployed, etc.

+3
source

Thanks. Now I understand the reason for overwriting SCM information.

However, the system / build process used requires URLs with the SVN username:

 scm:svn:svn+ssh:// user1@svn.company.com /svn/repo/project/path/trunk/ 

This username is different for each user and, of course, the user of the build system. I tried to do something similar above by specifying a username.

 svn+ssh://${svn-user}@svn.company.com/svn .... 

But, as was discovered above, SCM information is overwritten by the release plugin, using the last username instead of the parameter.

 svn+ssh:// user1@svn.company.com /svn ... 

I understand how the release plugin should maintain the state of the software in versions with a release label, but does it also need to be supported in the POM or HEAD version of the POM version?

+2
source

So far, there seems to be no solution: http://jira.codehaus.org/browse/MRELEASE-128

+1
source

All Articles