You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Jason Smith (JIRA)" <ji...@codehaus.org> on 2009/07/02 21:30:22 UTC

[jira] Issue Comment Edited: (MSITE-409) Incorrect URLs in multi-module project

    [ http://jira.codehaus.org/browse/MSITE-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=182327#action_182327 ] 

Jason Smith edited comment on MSITE-409 at 7/2/09 2:28 PM:
-----------------------------------------------------------

The problem appears to be the following code in SiteStageMojo.

        String outputRelativePath = PathTool.getRelativePath( stagingDirectory.getAbsolutePath(), new File(
            outputDirectory, "dummy.html" ).getAbsolutePath() );
        project.setUrl( outputRelativePath + "/" + structureProject );

If the staging folder is:
    C:\ws\target\staging

and the output-directory dummy file is:
    C:\ws\target\staging\base-parent-pom\utils-core\dummy.html

then the relative path is ../..

For each additional inherited parent POM, you get an additional '..'

The desired relative path is actually just "..", and I think this is always the case.  But I could be wrong.  But it works for me in all cases, and I am running many projects against this modification.

So for staging, at least, this works for my case:

        //String outputRelativePath = PathTool.getRelativePath( stagingDirectory.getAbsolutePath(), new File(
        //    outputDirectory, "dummy.html" ).getAbsolutePath() );
        project.setUrl( "../" + structureProject );

You have to replace outputRelativePath in a couple of places.

I am hoping that someone can take a look at this and verify whether or not this is a fix, and maybe roll it out to the plugin.

      was (Author: jasonsmith):
    The problem appears to be the following code in SiteStageMojo.

        String outputRelativePath = PathTool.getRelativePath( stagingDirectory.getAbsolutePath(), new File(
            outputDirectory, "dummy.html" ).getAbsolutePath() );
        project.setUrl( outputRelativePath + "/" + structureProject );

If the staging folder is:
    C:\ws\target\staging

and the output-directory dummy file is:
    C:\ws\target\staging\base-parent-pom\utils-core\dummy.html

then the relative path is ../..

For each additional inherited parent POM, you get an additional '..'

The desired path is actually just ".."

So for staging, at least, this works for my case:

        //String outputRelativePath = PathTool.getRelativePath( stagingDirectory.getAbsolutePath(), new File(
        //    outputDirectory, "dummy.html" ).getAbsolutePath() );
        project.setUrl( "../" + structureProject );

You have to replace outputRelativePath in a couple of places.

I am hoping that someone can take a look at this and verify whether or not this is a fix, and maybe roll it out to the plugin.
  
> Incorrect URLs in multi-module project
> --------------------------------------
>
>                 Key: MSITE-409
>                 URL: http://jira.codehaus.org/browse/MSITE-409
>             Project: Maven 2.x Site Plugin
>          Issue Type: Bug
>          Components: multi module
>    Affects Versions: 2.0
>            Reporter: Benson Margulies
>
> I have a top-level pom and some modules. One of the modules serves as a parent for most, but not all, of the rest.
> Thus, for most, the parent is ../parent, and for that the parent is the top-level project itself.
>  I ran:
> mvn site:stage -DstagingDirectory=/Users/benson/stage
> It takes a very long time.
> All of my child links came out incorrectly: e.g:
> <a href="../../Users/benson/x/trunk/greenhouse/etrog/../../../../hudson.basistech.net/home/projects/etrog">RLPJ Buildtools</a>
> There aren't distinct subdirectories in the staged dir for those of my modules that use the parent. Actually, now that I look, I see that the ones that parent into ../parent are subdirectories of 'parent' instead of subdirectories of the top-level. But the links are still all wrong.

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