[
http://jira.codehaus.org/browse/MSITE-423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=235122#action_235122
]
Roland Huss commented on MSITE-423:
-----------------------------------
I encounter the same problem and I could isolate it to be an issue with
PathUtils.getRelativePath() in doxia-sitetools. The issue is, that for *file*
URLs, which are used by site:stage to setup the links among sub-modules, the
relative path calculations seemed to be flawed. I don't have a fix yet, but
I've added a unit test which demonstrates this problem in isolation. The patch
attached is against doxia-sitetools, version 1.1.3 (which is used by
maven-site-plugin 3.x)
> <links> item hrefs not relativised properly when inherited by child modules
> ---------------------------------------------------------------------------
>
> Key: MSITE-423
> URL: http://jira.codehaus.org/browse/MSITE-423
> Project: Maven 2.x Site Plugin
> Issue Type: Bug
> Components: relative links
> Affects Versions: 2.1
> Environment: Linux, JDK 1.6.0_07, Maven 2.1.0
> Reporter: Robert Davey
> Attachments: doxia-sitetools.patch, site-plugin_link-problem.tar.gz
>
>
> See attachment for reproducible minimal case.
> I have a multi-module project, for the sake of argument laid out thus:
> * parent
> ** pom.xml
> * module1
> ** pom.xml
> ** src/site/site.xml
> ** apt/index.apt
>
> ** submodule1
> *** pom.xml
> *** src/site/site.xml
> *** apt/index.apt
> I specify some links in our parent POM that I want to be inherited by all
> child multi-modules. I would hope these links would always point to the
> relevant html files in the super parent project for all children, no matter
> the nesting level.
> <links>
> <item name="Home" href="/index.html"/>
> <item name="Getting Started" href="/getting-started.html"/>
> <item name="Documentation" href="/documentation.html"/>
> </links>
> These links work fine for the super parent menu. The same problem, outlined
> below, is apparent whether the links are prefixed by "/" or "./"
> When navigating down to module1, all the href links become:
> ../module1
> Navigating again down to submodule1 of module1, the links become (or
> something equally wacky):
> ../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../submodule1
> All the pom.xml files in each module refer to the staged url correctly, and
> these don't seem to make any difference to the eventual href whatsoever...
> e.g.
> parent: <url>http://server/</url>
> module1: <url>http://server/module1</url>
> submodule1: <url>http://server/module1/submodule1</url>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira