Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Not A Bug
-
Affects Version/s: 2.0-beta-5, 2.0-beta-6, 2.0-beta-7, 2.0, 2.0.1
-
Fix Version/s: None
-
Component/s: doxia integration, inheritance
-
Labels:None
-
Environment:Using maven 2.0.9 - and all versions of the site plugin all the way back to 2.0-beta-5.
Description
I'd like to have a parent project define what items are in a given menu for all child projects and let the child projects define the contents of those links (this doesn't work).
In the documentation for the site plugin here:
http://maven.apache.org/plugins/maven-site-plugin/examples/sitedescriptor.html
There is a bit in there about how to get a parent project site descriptor to be inherited by a child project by using the following:
<menu name="My Inherited Menu" inherit="top">
This is great if you want the child project to always link back to the parent project's links/pages for each menu option.
Doxia however shows this is configurable:
inheritAsRef - If this is a reference, setting true means that it will be populated in the project, whereas if it is false, it is populated in the parent and then inherited. The default value is false.
This property currently doesn't work.
-
Hide
- MSITE-420.zip
- 20/Jul/10 5:54 AM
- 36 kB
- Rüdiger zu Dohna
-
- MSITE-420/child/pom.xml 0.5 kB
- MSITE-420/child/src/site/apt/index.apt 0.3 kB
- MSITE-420/child/src/site/site.xml 0.3 kB
- MSITE-420/child/.../css/maven-base.css 2 kB
- MSITE-420/child/.../css/maven-theme.css 3 kB
- MSITE-420/child/target/.../css/print.css 0.2 kB
- MSITE-420/child/target/site/css/site.css 0.1 kB
- MSITE-420/child/.../site/dependencies.html 4 kB
- MSITE-420/child/target/.../images/close.gif 0.3 kB
- MSITE-420/child/.../images/collapsed.gif 0.1 kB
- MSITE-420/child/.../images/expanded.gif 0.1 kB
- MSITE-420/child/.../images/external.png 0.2 kB
- MSITE-420/child/.../icon_error_sml.gif 1.0 kB
- MSITE-420/child/.../images/icon_info_sml.gif 0.6 kB
- MSITE-420/child/.../icon_success_sml.gif 1.0 kB
- MSITE-420/child/.../icon_warning_sml.gif 0.6 kB
- MSITE-420/child/.../build-by-maven-black.png 2 kB
- MSITE-420/child/.../build-by-maven-white.png 2 kB
- MSITE-420/child/.../logos/maven-feather.png 3 kB
- MSITE-420/child/.../images/newwindow.png 0.2 kB
- MSITE-420/child/target/site/index.html 4 kB
- MSITE-420/child/.../site/integration.html 4 kB
- MSITE-420/child/.../site/issue-tracking.html 4 kB
- MSITE-420/child/target/site/license.html 4 kB
- MSITE-420/child/.../site/mail-lists.html 4 kB
- MSITE-420/child/.../plugin-management.html 7 kB
- MSITE-420/child/target/site/plugins.html 4 kB
- MSITE-420/child/.../site/project-info.html 6 kB
- MSITE-420/child/.../project-summary.html 5 kB
- MSITE-420/child/.../source-repository.html 4 kB
-
Hide
- MSITE-420.zip
- 01/Aug/09 9:24 AM
- 4 kB
- Lukas Theussl
-
- MSITE-420/pom.xml 0.7 kB
- MSITE-420/src/site/apt/index.apt 0.3 kB
- MSITE-420/src/site/site.xml 0.6 kB
- MSITE-420/child/pom.xml 0.4 kB
- MSITE-420/child/src/site/apt/index.apt 0.3 kB
- MSITE-420/child/src/site/site.xml 0.3 kB
Issue Links
- relates to
-
MSITE-159
Absolute URI rendered as relative URI if absolute URI related to domain of POM URI
-
Activity
I don't understand what you mean by relative then. Here's my "parent" menu structure:
<menu name="Documentation" inherit="top" inheritAsRef="true">
<item name="Overview" href="overview.html"/>
<item name="Building" collapse="true" href="building.html">
<item name="Locally" href="building-locally.html"/>
<item name="CI" href="building-ci.html"/>
</item>
<item name="Dependencies of note" href="dependencies-of-note.html"/>
<item name="Testing" href="testing.html"/>
<item name="Common problems" href="common-problems.html"/>
<item name="Stewards" ref="team-list.html"/>
</menu>
When the child project picks up this site descriptor, all the links are pointing to the parent site.
What am I missing?
I tried prefixing things with "./" but that didn't help.
Try the attached test project. Run 'mvn site' in the parent, then check that the files in the child/target/site folder all have links relative to the child (the files are not actually there, but the links are correct).
PS as I said above, the inheritAsRef attribute has no effect for menus that are no references
Hmm - that seems to work if it's a parent/child like this (where one contains the other). Our parent->child relationship is more like corp pom->other module (where they aren't nested).
How do I get this working?
wow... this is a funny bug! I hunted it down to the url tag. Just by adding that tag to the child pom breaks all links inherited from the parent site.xml.
Please find a modified MSITE-420.zip attached. I have also updated the version of the site plugin to 2.1.1 and added an About item mapped to the index.html, so it's quicker to see the difference.
If you add a url to the child you also have to add one to the parent. You didn't specify any distributionManagement url, in this case the site plugin will automatically add the child artifactId to the effective deploy location, so the child will be one directory below the parent. However, relative links are calculated from the project url, so if your parent has <url>http://parent/</url> then your child needs <url>http://parent/child/</url>.
Please open a new issue with a specific test project if anything is unclear.
If you specify the links in your inherited menu as relative links then they should end up pointing to the child project, not parent.
The inheritAsRef attribute only works with references, eg <menu ref="modules" inherit="bottom" /> and specifies whether the modules, in this case, are populated in the parent or child.
Otherwise, I'm not sure I understood what you want, maybe a small test project could help where you describe the effect you see vs what you expect. See
MSITE-293for an example.MSITE-293for an example.