[ 
http://jira.codehaus.org/browse/MSITE-180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_109894
 ] 

Benjamin Bentmann commented on MSITE-180:
-----------------------------------------

I am struggling with this problem, too. I tried the lastet 2.0-beta-6-SNAPSHOT 
but it crashes the build if neither parent nor child project have a <url> 
element:
{code}
java.lang.NullPointerException
        at 
org.apache.maven.doxia.site.decoration.inheritance.PathUtils.getRelativePath(PathUtils.java:83)
        at 
org.apache.maven.doxia.site.decoration.inheritance.PathUtils.convertPath(PathUtils.java:43)
        at 
org.apache.maven.doxia.site.decoration.inheritance.DefaultDecorationModelInheritanceAssembler.convertPath(DefaultDecorationModelInheritanceAssembler.java:334)
        at 
org.apache.maven.doxia.site.decoration.inheritance.DefaultDecorationModelInheritanceAssembler.resolveLinkItemPaths(DefaultDecorationModelInheritanceAssembler.java:255)
        at 
org.apache.maven.doxia.site.decoration.inheritance.DefaultDecorationModelInheritanceAssembler.mergeLinkItemLists(DefaultDecorationModelInheritanceAssembler.java:277)
        at 
org.apache.maven.doxia.site.decoration.inheritance.DefaultDecorationModelInheritanceAssembler.assembleBodyInheritance(DefaultDecorationModelInheritanceAssembler.java:192)
        at 
org.apache.maven.doxia.site.decoration.inheritance.DefaultDecorationModelInheritanceAssembler.assembleModelInheritance(DefaultDecorationModelInheritanceAssembler.java:83)
        at 
org.apache.maven.plugins.site.AbstractSiteRenderingMojo.getDecorationModel(AbstractSiteRenderingMojo.java:251)
        at 
org.apache.maven.plugins.site.AbstractSiteRenderingMojo.getDecorationModel(AbstractSiteRenderingMojo.java:523)
        at 
org.apache.maven.plugins.site.AbstractSiteRenderingMojo.createSiteRenderingContext(AbstractSiteRenderingMojo.java:462)
        at 
org.apache.maven.plugins.site.SiteMojo.renderLocale(SiteMojo.java:114)
        at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:97)
{code}

The good news: The inheritance problem in 2.0-beta-5 seems to be already fixed. 
When I hacked my local version of doxia-decoration-model to guard against the 
above null reference (i.e. newUrl) , the generated site properly inherited from 
its parent site.xml.

However, I could not come up with a clean patch for this. Right now, I do not 
see any point why a missing <url> element and an empty <url/> make such a big 
difference, from a pragmatic point of view they both deliver no information. If 
one leaves the <url>'s completely out, assembleModelInheritance() gets null's 
for both childBaseUrl and parentBaseUrl. This seems to disturb many of the path 
transforming methods in PathUtils, obviously. If one puts an empty <url> into 
the parent pom.xml, assembleModelInheritance() gets an empty string for the 
parentBaseUrl and something like "/sub-module" for the childBaseUrl. So, either 
get doxia-decoration-model to handle null's or update maven-site-plugin to 
preprocess the method arguments.

I confess that a unknown <url> for the projects is not really helpful but if 
optional information is not available, the site generation/inheritance should 
fail gracefully.

> Missing url tag in (parent) pom make it ignore the site inheritence system
> --------------------------------------------------------------------------
>
>                 Key: MSITE-180
>                 URL: http://jira.codehaus.org/browse/MSITE-180
>             Project: Maven 2.x Site Plugin
>          Issue Type: Bug
>          Components: inheritance
>    Affects Versions: 2.0-beta-5
>            Reporter: Geoffrey De Smet
>
> IF none of the poms (module or parent) don't have an url tag, like this:
> <project ...>
>   ...
>   <url>...</url>
>   ...
> </project>
> (It doesn't matter if they have url tags in scm, distribution etc)
> THEN site inheritence quitely isn't applied, for example in the parent's 
> site.xml
>         <menu name="Blogs" inherit="bottom">
>             <item name="maven" href="http://www.mavenblogs.org/"/>
>         </menu>
> isn't inherited in the childe module's site.
> proposed solutions:
>  - or fix it :)
>  - or document this wanted behaviour in the site plugin's documentation at
> http://maven.apache.org/plugins/maven-site-plugin/howto.html
> with something like
> "Site inheritence only works if you have a url tag in your parent pom."
> because this can cost people many hours - it did for me
> But once site inheritence works, it's very nice though :)

-- 
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

        

Reply via email to