You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Justin Robbins <ju...@gmail.com> on 2014/02/21 05:24:02 UTC

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

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

parent
  >  child-a
  >>   child-b

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.

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

Posted by Justin Robbins <ju...@gmail.com>.
I was able to fix this issue by adding a <url> element to the parent pom.
I don't understand why that would fix it tough.

Prior to adding the <url> element I saw this in the log:
[WARNING] No project URL defined - decoration links will not be relativized!

After adding <url> element the log shows this:
[INFO] Relativizing decoration links with respect to project URL:
https://github.com/justinhrobbins/multi-module-site-report-test

https://maven.apache.org/plugins/maven-site-plugin/faq.html#Use_of_url

Herve: thanks for your comments.  I confirmed v2.7 was indeed being used.
but i took your advice and added a direct dependency to 2.7.  there was no
change in behavior until i added the <url> element to the parent pom


On Sat, Feb 22, 2014 at 7:41 PM, Hervé BOUTEMY <he...@free.fr>wrote:

> looks like a bug in maven-project-info-reports-plugin, which is the plugin
> launched by maven-site-plugin to generate every "Project information"
> reports
>
> Notice: m-site-p launches plugins for each report, then a failure when
> generating a site is not always a m-site-p bug. But every bug in every
> report
> plugin launched by m-site-p is sometimes (often?) seen as m-site-p bug :)
>
> I see you defined
>
> <maven.project.info.reports.plugin.version>2.7</maven.project.info.reports.plugin.version>
> but you don't use it: are you sure that the latest plugin version is used
> in
> your test?
>
> Regards,
>
> Hervé
>
> Le jeudi 20 février 2014 21:24:02 Justin Robbins a écrit :
> > I am creating a Maven Site for a 3-level multi-module maven project which
> > is structured like this:
> >
> > parent
> >
> >   >  child-a
> >   >
> >   >>   child-b
> >
> > 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-SNA
> > PSHOT/
> >
> > 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/Distrib
> > utionMgtInEachModule
> >
> > 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.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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

Posted by Hervé BOUTEMY <he...@free.fr>.
looks like a bug in maven-project-info-reports-plugin, which is the plugin 
launched by maven-site-plugin to generate every "Project information" reports

Notice: m-site-p launches plugins for each report, then a failure when 
generating a site is not always a m-site-p bug. But every bug in every report 
plugin launched by m-site-p is sometimes (often?) seen as m-site-p bug :)

I see you defined 
<maven.project.info.reports.plugin.version>2.7</maven.project.info.reports.plugin.version>
but you don't use it: are you sure that the latest plugin version is used in 
your test?

Regards,

Hervé

Le jeudi 20 février 2014 21:24:02 Justin Robbins a écrit :
> I am creating a Maven Site for a 3-level multi-module maven project which
> is structured like this:
> 
> parent
> 
>   >  child-a
>   >  
>   >>   child-b
> 
> 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-SNA
> PSHOT/
> 
> 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/Distrib
> utionMgtInEachModule
> 
> 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.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org