Tuesday, August 15, 2006

Maven 2 site plugin woes

We're using Maven 2 here to manage our build process, and I'd like to make the maven-generated site our main source for developer documentation since it already hosts reports, JavaDocs, etc. Unfortunately, the site plug-in (currently at version 2.0-beta-5 I believe) is not exactly being cooperative. I have some menus defined in site.xml for the top-level project which I do not want inherited by sub-projects. According to maven documentation, the default behavior is that menus are not inherited. And yet... they are. So I included the inherit="none" attribute on the <menu> tag in question, build and deploy the top-level site, build and deploy a child module's site, and the menus are still inherited. And the links are wrong. Grr.

While adding breadcrumbs, I discovered my mistake: in order for the inheritance settings to work correctly, the child modules have to have their own site.xml files. If a child module doesn't have its own site.xml, then it appears as if maven uses the parent site.xml for the child module instead of using default-site.xml for the child and inheriting from the parent site.xml, like I expected.

No comments: