I have a Maven project consisting of several modules and submodules. I use SVN for the version of the source files.
Story
How to specify the URL in the scm properties of the POM file that are related to the parents.
Long story
Some modules and their auxiliary modules have a common version / release number, and some use independent ones. For a module with an independent version number, I configured the layout of the branches / trunk / tags so that the release plugin is happy.
For this, I have two SVN layouts in my repository. One of them holds all the messes of the connecting lines / branches / tags, and the other contains a clean working directory, ready to be checked, with svn: external links to the connecting lines.
It looks like this: You have a real-world SVN layout, with a mess in the trunk / branches / tags:
- pom.xml (primary parent)
- Utils
- branches
- tags
- Trunk
- pom.xml, src, target, etc.
- data model (released)
- branches
- tags
- Trunk
- pom.xml
- Lib
- pom.xml, src, target, etc.
- server
- pom.xml, src, target, etc.
- client
- pom.xml, src, target, etc.
- bin modules
- bin-module-1 (released)
- branches
- tags
- Trunk
- pom.xml, src, target, etc.
- bin-module-2 (released)
- branches
- tags
- Trunk
- pom.xml, src, target, etc.
And a clean working code layout separating branches / trunk with tags "svn: externals":
- pom.xml (primary parent)
- utils (-> utils / trunk)
- pom.xml, src, target, etc.
- data model (-> data model / trunk)
- pom.xml
- Lib
- pom.xml, src, target, etc.
- server
- pom.xml, src, target, etc.
- client
- pom.xml, src, target, etc.
- bin modules
- pom.xml
- bin-module-1 (-> bin-module-1 / trunk)
- pom.xml, src, target, etc.
- bin-module-2 (-> bin-module-2 / trunk)
- pom.xml, src, target, etc.
So far so good. I set the SCM root URLs in my parent POM, and Maven correctly specifies the URLs for the submodules. I checked it with mvn help:effective-pom
I have the following scm urls:
- root : [root-url]
- utils : [root-url] / utils
- data model : [root-url] / data-model /
- data-model / lib : [root-url] / data-model / lib
- data-model / client : [root-url] / data-model / client
- data-model / server : [root-url] / data-model / server
- bin-module-1 : [root-url] / bin-module-1 /
- bin-module-2 : [root-url] / bin-module-2 /
But Maven is not aware of the actual layout of SVN. I would like him to see:
- root : [root-url]
- utils : [root-url] / utils / trunk
- data model : [root-url] / data-model / trunk
- data-model / lib : [root-url] / data-model / trunk / lib
- data-model / client : [root-url] / data-model / trunk / client
- data model / server : [root-url] / data-model / trunk / server
- bin-module-1 : [root-url] / bin-module-1 / trunk
- bin-module-2 : [root-url] / bin-module-2 / trunk
To do this, I need to add the scm section to the pom.xml data model, bin-module-1 and bin-module-2.
I tried something like (for a data model):
<scm> <connection>./data-model/trunk</connection> <developerConnection>./sdr/trunk</developerConnection> <url>./sdr/trunk</url </scm>
Or
<scm> <connection>${project.parent.scm.connection}/data-model/trunk</connection> <developerConnection>${project.parent.scm.developerConnection}/data-model/trunk</developerConnection> <url>${project.parent.scm.url}/data-model/trunk</url> </scm>
But nobody is working. The properties of $ {...} are not even replaced. So, how do I redefine the SCM path in relation to its SCM parent URL?
Any help, advice would be greatly appreciated.
Thanks in advance, Raphael