[ http://jira.codehaus.org/browse/MSITE-144?page=comments#action_75781 ] 
            
Steffan commented on MSITE-144:
-------------------------------

The issue origins seems to be the DefaultModelInheritanceAssembler.class wich 
automatically adds the parents artifactId no matter what.
According to the site-plugin in documentation the inheritance of the parents 
artifactId can enabled by adding a trailing / to the url.
But the InheritanceModel doesnt apply this rule.

Details on: http://maven.apache.org/guides/mini/guide-site.html
Note: the trailing slash in the URL above indicates that any subprojects that 
inherit this value should append their artifact ID to the path instead of using 
it as-is.

My solution, the method assembleDistributionInheritence(...) should be modified 
like this:

...
            if ( childDistMgmt.getSite() == null )
            {
                if ( parentDistMgmt.getSite() != null )
                {
                    Site site = new Site();
                    childDistMgmt.setSite( site );
                    site.setId( parentDistMgmt.getSite().getId() );
                    site.setName( parentDistMgmt.getSite().getName() );
                    site.setUrl( parentDistMgmt.getSite().getUrl() );
                    // modification, add the .endWith("/") to the condition 
                    if ( site.getUrl() != null && site.getUrl().endsWith( "/" ) 
)
                    {
                            site.setUrl( appendPath( site.getUrl(), 
child.getArtifactId(), appendPaths ) );
                    }
                }
            }
...

> inherited site url not properly handling parameters
> ---------------------------------------------------
>
>                 Key: MSITE-144
>                 URL: http://jira.codehaus.org/browse/MSITE-144
>             Project: Maven 2.x Site Plugin
>          Issue Type: Bug
>    Affects Versions: 2.0-beta-5
>            Reporter: Jacob Robertson
>
> Here is the test case to reroduce this problem.  Take the following two 
> pom.xml files
> <?xml version="1.0" encoding="UTF-8"?>
> <project>
>       <groupId>org.bar</groupId>
>       <artifactId>foo</artifactId>
>       <name>foo</name>
>       <version>1.0-SNAPSHOT</version>
>       <packaging>pom</packaging>
>       <modelVersion>4.0.0</modelVersion>
>       <distributionManagement>
>               <site>
>                       <id>foo-site</id>
>                       <url>file://C:/Documents and 
> Settings/foo/.m2/site/${project.artifactId}</url>
>               </site>
>       </distributionManagement>
> </project>
> <?xml version="1.0" encoding="UTF-8"?>
> <project>
>       <groupId>org.bar</groupId>
>       <artifactId>baz</artifactId>
>       <name>baz</name>
>       <version>1.0-SNAPSHOT</version>
>       <packaging>pom</packaging>
>       <modelVersion>4.0.0</modelVersion>
>       <parent>
>               <artifactId>foo</artifactId>
>               <groupId>org.bar</groupId>
>               <version>1.0-SNAPSHOT</version>
>       </parent>
> </project>
> And run the site-deploy goal on each.  What you get under the site directory 
> is this
> - site
> /- foo
> ---/site docs
> /- baz
> ---/- baz (extra directory)
> --- ---/site docs
> This is the simplest test case.  In the case where I have a "grandparent" 
> pom, the site directory uses the grandparent/parent as the path to the site, 
> and doesn't use the actual artifactId of the artifact I'm creating the site 
> for.

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