3

My maven distributionManagement section in my base pom.xml for the site looks like this:

<distributionManagement>
    <site>
        <id>main-site</id>
        <name>Main Artifact Site</name>
        <url>scp:/somurl/site/${project.groupId}/${project.artifactId}/${project.version}</url>
    </site>
</distributionManagement>

We have a base pom.xml, which several projects inherit from. These projects, in turn, have several modules (each with their own poms).

As you can see, the url we pass takes care of uniquely identifying each project/model. Maven appends an extra artifactId after the version for each inherited pom. I would like to stop that behavior. It leaves us with url's like

http://someurl/site/com.whatever.something/some-project-parent/1.14/some-project-parent
http://someurl/site/com.whatever.something/some-project-module/1.14/some-project-parent/some-project-module

I would like for these urls to look like

http://someurl/site/com.whatever.something/some-project-parent/1.14/
http://someurl/site/com.whatever.something/some-project-module/1.14/

The solution I have found is not DRY. It involves copy/pasting this distributionManagement section into every pom.xml.

Any ideas on how to stop this behavior? Thanks in advance!

Noah
  • 1,608
  • 15
  • 31
  • no. the only solution I am aware of as well is to copy the distributionManagement. I think some reporting plugins even mix up artifatcId and module-name. So if those don't match the site will have invalid links. An alternative might be to generate the site and use the assembly plugin to pack the sites together and then copy them to some webserver to be viewable? That would allow to define the structure. – wemu Jul 28 '15 at 08:09

0 Answers0