You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Benson Margulies (JIRA)" <ji...@codehaus.org> on 2009/06/26 02:12:54 UTC

[jira] Created: (MSITE-409) Incorrect URLs in multi-module project

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

        

[jira] Commented: (MSITE-409) Incorrect URLs in multi-module project

Posted by "Benson Margulies (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSITE-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=182356#action_182356 ] 

Benson Margulies commented on MSITE-409:
----------------------------------------

DId you mean to put that comment here?

> 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

        

[jira] Commented: (MSITE-409) Incorrect URLs in multi-module project

Posted by "Benson Margulies (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSITE-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=183556#action_183556 ] 

Benson Margulies commented on MSITE-409:
----------------------------------------

The proposed fix doesn't do the job. The code still tries to follow the project hierarchy.

> 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
>         Attachments: tc.patch.diff
>
>
> 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

        

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

Posted by "Jason Smith (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSITE-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=182352#action_182352 ] 

Jason Smith edited comment on MSITE-409 at 7/9/09 11:34 AM:
------------------------------------------------------------

So here is what I see going on.  I am building a number of projects involving a multi-level parent-pom hierarchy.  Here are the projects in my reactor just before I build the menu items for the Module section:

[INFO] Reactor projects:
        base-xml        : ../base-xml
        base-parent-pom : ../../base-parent-pom
        utils-core      : ../../base-parent-pom/utils-core
        utils-cli       : ../../base-parent-pom/utils-cli
        buildtools-parent-pom   : ../../../base-parent-pom/buildtools-parent-pom
        buildtools-core : ../../../base-parent-pom/buildtools-parent-pom/buildtools-core
        maven-buildtools-plugin : ../../../base-parent-pom/buildtools-parent-pom/maven-buildtools-plugin
        buildtools      : ../../../base-parent-pom/buildtools-parent-pom/buildtools
        buildtools-aggregator-project   : ../../../base-parent-pom/buildtools-parent-pom/buildtools-aggregator-project

NOTE: All the relative paths at this point are correct.  If Doxia site tools would leave them as they are, everything would be peachy.

The last project in this list is the module-pom.  It just aggregates and creates APT documentation.

NOTICE that ALL URLs are relative.  ALL of them.  This is set up by the SiteStageMojo class.

In maven-doxia-tools-1.0.2, DefaultSiteTool#appendMenuItem (around line 1447), it is taking the original relative path for each project, and re-relativizing against the relative path of the buildtools-aggregator-project. That is, DefaultSiteTool is running:

*    getRelativePath(project, aggregatorProject)  

where

*    project might be ../../base-parent-pom/utils-cli
and
*    aggregatorProject is ../../../base-parent-pom/buildtools-parent-pom/buildtools-aggregator-project

The funny thing is, the original paths are correct.  The code that puts the paths into the menus is screwing it up.

So DefaultSiteTool is relativizing a relative path against a relative path, and I think that is where the problem lies.  I am looking for a good solution to this problem, but I will be the first to admit that I don't understand all ramifications of code changes here.

--------------------------------------------------------------------------------

UPDATE:

I commented out all the references to outputRelativePath in SiteStageMojo#execute, like this.

* project.setUrl( /*outputRelativePath +*/ "/" + structureProject );

This makes all the project URLs semi-absolute. 

Now it all seems to work.  I am not sure if this is the best fix, but what's released right now is definitely broken.

      was (Author: jasonsmith):
    So here is what I see going on.  I am building a number of projects involving a multi-level parent-pom hierarchy.  Here are the projects in my reactor just before I build the menu items for the Module section:

[INFO] Reactor projects:
        base-xml        : ../base-xml
        base-parent-pom : ../../base-parent-pom
        utils-core      : ../../base-parent-pom/utils-core
        utils-cli       : ../../base-parent-pom/utils-cli
        buildtools-parent-pom   : ../../../base-parent-pom/buildtools-parent-pom
        buildtools-core : ../../../base-parent-pom/buildtools-parent-pom/buildtools-core
        maven-buildtools-plugin : ../../../base-parent-pom/buildtools-parent-pom/maven-buildtools-plugin
        buildtools      : ../../../base-parent-pom/buildtools-parent-pom/buildtools
        buildtools-aggregator-project   : ../../../base-parent-pom/buildtools-parent-pom/buildtools-aggregator-project

NOTE: All the relative paths at this point are correct.  If Doxia site tools would leave them as they are, everything would be peachy.

The last project in this list is the module-pom.  It just aggregates and creates APT documentation.

NOTICE that ALL URLs are relative.  ALL of them.  This is set up by the SiteStageMojo class.

In maven-doxia-tools-1.0.2, DefaultSiteTool#appendMenuItem (around line 1447), it is taking the original relative path for each project, and re-relativizing against the relative path of the buildtools-aggregator-project. That is, DefaultSiteTool is running:

*    getRelativePath(project, aggregatorProject)  

where

*    project might be ../../base-parent-pom/utils-cli
and
*    aggregatorProject is ../../../base-parent-pom/buildtools-parent-pom/buildtools-aggregator-project

The funny thing is, the original paths are correct.  The code that puts the paths into the menus is screwing it up.

So DefaultSiteTool is relativizing a relative path against a relative path, and I think that is where the problem lies.  I am looking for a good solution to this problem, but I will be the first to admit that I don't understand all ramifications of code changes here.
  
> 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

        

[jira] Commented: (MSITE-409) Incorrect URLs in multi-module project

Posted by "Benson Margulies (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSITE-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=181557#action_181557 ] 

Benson Margulies commented on MSITE-409:
----------------------------------------

I turn out to have hit two problems here. One is MSITE-395. The other has to do with parent structure, so I'll detail it more clearly.
{noformat}
                         pom.xml
                              |
          -----------------------------------
          |         |          |           |
    parent   mod1 mod2  mod3
{noformat}

In, say, mod1, the pom.xml declares the parent to have a relative path of ../parent.
In parent, the parent is the toplevel project.

If I run the site plugin at toplevel, the modN modules have their sites generated inside of the directory of the parent module. Explicitly declaring the URL doesn't help. I guess explicitly declaring the distributionManagement URL might help.



> 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

        

[jira] Commented: (MSITE-409) Incorrect URLs in multi-module project

Posted by "Benson Margulies (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSITE-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=182259#action_182259 ] 

Benson Margulies commented on MSITE-409:
----------------------------------------

I'm not on Linux and this problem happens with plain old site:deploy. The site plugin is assuming that the tree hierarchy and the parent hierarchy are the same. This is not necessarily the state of affairs. Some of us have additional levels of parent that are used to share configuration with a different topology than our tree of <module/> relationships. The parent relationship is not necessarily simply a backpointer to the module relationship.

> 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

        

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

Posted by "Jason Smith (JIRA)" <ji...@codehaus.org>.
    [ 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 6:27 PM:
-----------------------------------------------------------

The problem appears to be the following code in SiteStageMojo.  It is not specific to Linux, and occurs on both Windows and Linux.

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

        

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

Posted by "Jason Smith (JIRA)" <ji...@codehaus.org>.
    [ 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/9/09 11:08 AM:
------------------------------------------------------------

*OBSOLETE* See next comment.

The problem appears to be the following code in SiteStageMojo.  It is not specific to Linux, and occurs on both Windows and Linux.

        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.  It is not specific to Linux, and occurs on both Windows and Linux.

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

        

[jira] Commented: (MSITE-409) Incorrect URLs in multi-module project

Posted by "Jason Smith (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSITE-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=182327#action_182327 ] 

Jason Smith commented on MSITE-409:
-----------------------------------

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

        

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

Posted by "Jason Smith (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSITE-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=182352#action_182352 ] 

Jason Smith edited comment on MSITE-409 at 7/9/09 11:08 AM:
------------------------------------------------------------

So here is what I see going on.  I am building a number of projects involving a multi-level parent-pom hierarchy.  Here are the projects in my reactor just before I build the menu items for the Module section:

[INFO] Reactor projects:
        base-xml        : ../base-xml
        base-parent-pom : ../../base-parent-pom
        utils-core      : ../../base-parent-pom/utils-core
        utils-cli       : ../../base-parent-pom/utils-cli
        buildtools-parent-pom   : ../../../base-parent-pom/buildtools-parent-pom
        buildtools-core : ../../../base-parent-pom/buildtools-parent-pom/buildtools-core
        maven-buildtools-plugin : ../../../base-parent-pom/buildtools-parent-pom/maven-buildtools-plugin
        buildtools      : ../../../base-parent-pom/buildtools-parent-pom/buildtools
        buildtools-aggregator-project   : ../../../base-parent-pom/buildtools-parent-pom/buildtools-aggregator-project

NOTE: All the relative paths at this point are correct.  If Doxia site tools would leave them as they are, everything would be peachy.

The last project in this list is the module-pom.  It just aggregates and creates APT documentation.

NOTICE that ALL URLs are relative.  ALL of them.  This is set up by the SiteStageMojo class.

In maven-doxia-tools-1.0.2, DefaultSiteTool#appendMenuItem (around line 1447), it is taking the original relative path for each project, and re-relativizing against the relative path of the buildtools-aggregator-project. That is, DefaultSiteTool is running:

*    getRelativePath(project, aggregatorProject)  

where

*    project might be ../../base-parent-pom/utils-cli
and
*    aggregatorProject is ../../../base-parent-pom/buildtools-parent-pom/buildtools-aggregator-project

The funny thing is, the original paths are correct.  The code that puts the paths into the menus is screwing it up.

So DefaultSiteTool is relativizing a relative path against a relative path, and I think that is where the problem lies.  I am looking for a good solution to this problem, but I will be the first to admit that I don't understand all ramifications of code changes here.

      was (Author: jasonsmith):
    See the comments on MSITE-409.  I think this might be related.  
  
> 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

        

[jira] Commented: (MSITE-409) Incorrect URLs in multi-module project

Posted by "Jason Smith (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSITE-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=182352#action_182352 ] 

Jason Smith commented on MSITE-409:
-----------------------------------

See the comments on MSITE-409.  I think this might be related.  

> 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

        

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

Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSITE-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=182352#action_182352 ] 

Dennis Lundberg edited comment on MSITE-409 at 7/9/09 1:01 PM:
---------------------------------------------------------------

So here is what I see going on.  I am building a number of projects involving a multi-level parent-pom hierarchy.  Here are the projects in my reactor just before I build the menu items for the Module section:

[INFO] Reactor projects:
        base-xml        : ../base-xml
        base-parent-pom : ../../base-parent-pom
        utils-core      : ../../base-parent-pom/utils-core
        utils-cli       : ../../base-parent-pom/utils-cli
        buildtools-parent-pom   : ../../../base-parent-pom/buildtools-parent-pom
        buildtools-core : ../../../base-parent-pom/buildtools-parent-pom/buildtools-core
        maven-buildtools-plugin : ../../../base-parent-pom/buildtools-parent-pom/maven-buildtools-plugin
        buildtools      : ../../../base-parent-pom/buildtools-parent-pom/buildtools
        buildtools-aggregator-project   : ../../../base-parent-pom/buildtools-parent-pom/buildtools-aggregator-project

NOTE: All the relative paths at this point are correct.  If Doxia site tools would leave them as they are, everything would be peachy.

The last project in this list is the module-pom.  It just aggregates and creates APT documentation.

NOTICE that ALL URLs are relative.  ALL of them.  This is set up by the SiteStageMojo class.

In maven-doxia-tools-1.0.2, DefaultSiteTool#appendMenuItem (around line 1447), it is taking the original relative path for each project, and re-relativizing against the relative path of the buildtools-aggregator-project. That is, DefaultSiteTool is running:

*    getRelativePath(project, aggregatorProject)  

where

*    project might be ../../base-parent-pom/utils-cli
and
*    aggregatorProject is ../../../base-parent-pom/buildtools-parent-pom/buildtools-aggregator-project

The funny thing is, the original paths are correct.  The code that puts the paths into the menus is screwing it up.

So DefaultSiteTool is relativizing a relative path against a relative path, and I think that is where the problem lies.  I am looking for a good solution to this problem, but I will be the first to admit that I don't understand all ramifications of code changes here.

--------------------------------------------------------------------------------

UPDATE:

I commented out all the references to outputRelativePath in SiteStageMojo#execute, like this.

{code}
project.setUrl( /*outputRelativePath +*/ "/" + structureProject );
{code}

This makes all the project URLs semi-absolute. 

Now it all seems to work.  I am not sure if this is the best fix, but what's released right now is definitely broken.

      was (Author: jasonsmith):
    So here is what I see going on.  I am building a number of projects involving a multi-level parent-pom hierarchy.  Here are the projects in my reactor just before I build the menu items for the Module section:

[INFO] Reactor projects:
        base-xml        : ../base-xml
        base-parent-pom : ../../base-parent-pom
        utils-core      : ../../base-parent-pom/utils-core
        utils-cli       : ../../base-parent-pom/utils-cli
        buildtools-parent-pom   : ../../../base-parent-pom/buildtools-parent-pom
        buildtools-core : ../../../base-parent-pom/buildtools-parent-pom/buildtools-core
        maven-buildtools-plugin : ../../../base-parent-pom/buildtools-parent-pom/maven-buildtools-plugin
        buildtools      : ../../../base-parent-pom/buildtools-parent-pom/buildtools
        buildtools-aggregator-project   : ../../../base-parent-pom/buildtools-parent-pom/buildtools-aggregator-project

NOTE: All the relative paths at this point are correct.  If Doxia site tools would leave them as they are, everything would be peachy.

The last project in this list is the module-pom.  It just aggregates and creates APT documentation.

NOTICE that ALL URLs are relative.  ALL of them.  This is set up by the SiteStageMojo class.

In maven-doxia-tools-1.0.2, DefaultSiteTool#appendMenuItem (around line 1447), it is taking the original relative path for each project, and re-relativizing against the relative path of the buildtools-aggregator-project. That is, DefaultSiteTool is running:

*    getRelativePath(project, aggregatorProject)  

where

*    project might be ../../base-parent-pom/utils-cli
and
*    aggregatorProject is ../../../base-parent-pom/buildtools-parent-pom/buildtools-aggregator-project

The funny thing is, the original paths are correct.  The code that puts the paths into the menus is screwing it up.

So DefaultSiteTool is relativizing a relative path against a relative path, and I think that is where the problem lies.  I am looking for a good solution to this problem, but I will be the first to admit that I don't understand all ramifications of code changes here.

--------------------------------------------------------------------------------

UPDATE:

I commented out all the references to outputRelativePath in SiteStageMojo#execute, like this.

* project.setUrl( /*outputRelativePath +*/ "/" + structureProject );

This makes all the project URLs semi-absolute. 

Now it all seems to work.  I am not sure if this is the best fix, but what's released right now is definitely broken.
  
> 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

        

[jira] Closed: (MSITE-409) Incorrect URLs in multi-module project

Posted by "Lukas Theussl (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MSITE-409?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukas Theussl closed MSITE-409.
-------------------------------

      Assignee: Lukas Theussl
    Resolution: Fixed

The URL problem is fixed as far as I can see, please open another ticket with a specific test case if you still have problems.

> 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
>            Assignee: Lukas Theussl
>             Fix For: 2.1
>
>         Attachments: tc.patch.diff
>
>
> 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

        

[jira] Updated: (MSITE-409) Incorrect URLs in multi-module project

Posted by "Benson Margulies (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MSITE-409?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benson Margulies updated MSITE-409:
-----------------------------------

    Attachment: tc.patch.diff

Here is a test case.

> 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
>         Attachments: tc.patch.diff
>
>
> 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

        

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

Posted by "Jason Smith (JIRA)" <ji...@codehaus.org>.
    [ 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

        

[jira] Commented: (MSITE-409) Incorrect URLs in multi-module project

Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSITE-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=182208#action_182208 ] 

Dennis Lundberg commented on MSITE-409:
---------------------------------------

If you are on Linux, the problem with incorrect URLs are tracked in MSITE-404.

> 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

        

[jira] Commented: (MSITE-409) Incorrect URLs in multi-module project

Posted by "Lukas Theussl (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MSITE-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=185067#action_185067 ] 

Lukas Theussl commented on MSITE-409:
-------------------------------------

The links issue is fixed with MSITE-404, please test with site-plugin-2.1-SNAPSHOT.

The hierarchy problem is more general, it should get it's own issue. However, my impression is that you should be able to fix it by adjusting your document structure, eg

{noformat}
                   pom.xml
                      |
                    parent
                      |
        ------------------------------
          |            |           |
        mod1         mod2        mod3
{noformat}

or

{noformat}
                         parent
                           |
          -----------------------------------
          |         |          |           |
       pom.xml     mod1       mod2        mod3
{noformat}

and setting the <modules> accordingly.

> 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
>             Fix For: 2.1
>
>         Attachments: tc.patch.diff
>
>
> 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