Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

How to fix broken sub-module links in Maven Site for multi-module project?

$
0
0
I am creating a Maven Site for a 3-level multi-module maven project which
is structured like this:

parent

I am running mvn site site:stage

The Maven site module link (from the About page) works for child-a but is
broken for the nested module child-b. (The link to child-b does work if I
first click the link to child-a.)

See for yourself here:
http://justinhrobbins.github.io/multi-module-site-report-test/site/0.0.1-SNAPSHOT/

I have the following in my parent pom:

<distributionManagement>
<site>
<id>site</id>
<name>site</name>
<url>scp://www.yourcompany.com/www/docs/project/</url>
</site>
</distributionManagement>

What needs to be done in order for the links to work for all the project
modules in this Maven site report? (i know the is not real, for the moment
i want it to work in stage)

I added a simple test case project to Github that demonstrates the issue:
https://github.com/justinhrobbins/multi-module-site-report-test

I am using the following plugin versions:

<maven.site.plugin.version>3.3</maven.site.plugin.version>
<maven.source.plugin.version>2.2.1</maven.source.plugin.version>

I have also tried adding distributionManagement/site/url to each child
module. That fixes the link to child-b from the main Site page, but then
the link from child-a to child-b is broken. These changes can be found in
this branch:
https://github.com/justinhrobbins/multi-module-site-report-test/tree/DistributionMgtInEachModule

I have read the following relevant pages in the docs:
http://maven.apache.org/plugins/maven-site-plugin/examples/multimodule.html
http://maven.apache.org/plugins/maven-site-plugin/faq.html#Use_of_url

Any suggestions are appreciated.

Viewing all articles
Browse latest Browse all 5648

Trending Articles