You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org> on 2007/12/10 17:59:57 UTC
[jira] Created: (MNG-3315) Path normalization during inheritance
prohibits usage of properties
Path normalization during inheritance prohibits usage of properties
-------------------------------------------------------------------
Key: MNG-3315
URL: http://jira.codehaus.org/browse/MNG-3315
Project: Maven 2
Issue Type: Bug
Components: Inheritance and Interpolation
Affects Versions: 2.0.8
Reporter: Benjamin Bentmann
Assume a multi-module scenario with the following (non-standard) directory layout:
project/
project-parent/
project-module-1/
project-module-2/
That is, the parent POM is placed in a sibling directory rather than the parent directory of the module projects such that the "module path adjustment" is "../" when inheriting paths/URLs from the project-parent.
Now, consider the following POM snippet for the site distribution (or any other element where Maven adjusts paths for sub modules):
{code:xml}
<site>
<id>website</id>
<url>dav:http://www.company.org/project</url>
</site>
{code}
All fine so far, but this slightly modified snippet does not work any more:
{code:xml}
<properties>
<site.url>dav:http://www.company.org/project</site.url>
</properties>
...
<site>
<id>website</id>
<url>${site.url}</url>
</site>
{code}
Just replacing the string by a property produces a bad URL for any sub project. This problems originates from DefaultModelInheritanceAssembler.resolvePath() that "normalizes" a string like "${site.url}/../project-module-1" to "project-module-1".
While the usage of the property is not mandatory, I nevertheless think the moral from this subtle issue should be not to do any path normalization until all properties have been interpolated, i.e.:
- inheritance ( URL = "${site.url}/../project-module-1" )
- interpolation ( URL = "dav:http://www.company.org/project/../project-module-1" )
- path/URL normalization ( URL = "dav:http://www.company.org/project-module-1" )
Otherwise, Maven calls another weird pitfall its own.
--
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: (MNG-3315) Path normalization during inheritance
prohibits usage of properties
Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benjamin Bentmann updated MNG-3315:
-----------------------------------
Attachment: project.zip
This dummy projects demonstrates the issue. Just run "mvn site" and look at the URLs given by "Project Source Repository" or "Project Summary" for project-module-1.
> Path normalization during inheritance prohibits usage of properties
> -------------------------------------------------------------------
>
> Key: MNG-3315
> URL: http://jira.codehaus.org/browse/MNG-3315
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.8
> Reporter: Benjamin Bentmann
> Attachments: project.zip
>
>
> Assume a multi-module scenario with the following (non-standard) directory layout:
> project/
> project-parent/
> project-module-1/
> project-module-2/
> That is, the parent POM is placed in a sibling directory rather than the parent directory of the module projects such that the "module path adjustment" is "../" when inheriting paths/URLs from the project-parent.
> Now, consider the following POM snippet for the site distribution (or any other element where Maven adjusts paths for sub modules):
> {code:xml}
> <site>
> <id>website</id>
> <url>dav:http://www.company.org/project</url>
> </site>
> {code}
> All fine so far, but this slightly modified snippet does not work any more:
> {code:xml}
> <properties>
> <site.url>dav:http://www.company.org/project</site.url>
> </properties>
> ...
> <site>
> <id>website</id>
> <url>${site.url}</url>
> </site>
> {code}
> Just replacing the string by a property produces a bad URL for any sub project. This problems originates from DefaultModelInheritanceAssembler.resolvePath() that "normalizes" a string like "${site.url}/../project-module-1" to "project-module-1".
> While the usage of the property is not mandatory, I nevertheless think the moral from this subtle issue should be not to do any path normalization until all properties have been interpolated, i.e.:
> - inheritance ( URL = "${site.url}/../project-module-1" )
> - interpolation ( URL = "dav:http://www.company.org/project/../project-module-1" )
> - path/URL normalization ( URL = "dav:http://www.company.org/project-module-1" )
> Otherwise, Maven calls another weird pitfall its own.
--
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: (MNG-3315) Path normalization during inheritance
prohibits usage of properties
Posted by "Jason van Zyl (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jason van Zyl updated MNG-3315:
-------------------------------
Fix Version/s: (was: 2.2.x)
3.0-alpha-7
> Path normalization during inheritance prohibits usage of properties
> -------------------------------------------------------------------
>
> Key: MNG-3315
> URL: http://jira.codehaus.org/browse/MNG-3315
> Project: Maven 2 & 3
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.8
> Reporter: Benjamin Bentmann
> Fix For: 3.0-alpha-7
>
> Attachments: project.zip
>
>
> Assume a multi-module scenario with the following (non-standard) directory layout:
> project/
> project-parent/
> project-module-1/
> project-module-2/
> That is, the parent POM is placed in a sibling directory rather than the parent directory of the module projects such that the "module path adjustment" is "../" when inheriting paths/URLs from the project-parent.
> Now, consider the following POM snippet for the site distribution (or any other element where Maven adjusts paths for sub modules):
> {code:xml}
> <site>
> <id>website</id>
> <url>dav:http://www.company.org/project</url>
> </site>
> {code}
> All fine so far, but this slightly modified snippet does not work any more:
> {code:xml}
> <properties>
> <site.url>dav:http://www.company.org/project</site.url>
> </properties>
> ...
> <site>
> <id>website</id>
> <url>${site.url}</url>
> </site>
> {code}
> Just replacing the string by a property produces a bad URL for any sub project. This problems originates from DefaultModelInheritanceAssembler.resolvePath() that "normalizes" a string like "${site.url}/../project-module-1" to "project-module-1".
> While the usage of the property is not mandatory, I nevertheless think the moral from this subtle issue should be not to do any path normalization until all properties have been interpolated, i.e.:
> - inheritance ( URL = "${site.url}/../project-module-1" )
> - interpolation ( URL = "dav:http://www.company.org/project/../project-module-1" )
> - path/URL normalization ( URL = "dav:http://www.company.org/project-module-1" )
> Otherwise, Maven calls another weird pitfall its own.
--
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: (MNG-3315) Path normalization during inheritance
prohibits usage of properties
Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benjamin Bentmann closed MNG-3315.
----------------------------------
Resolution: Duplicate
Fix Version/s: (was: 3.0-alpha-8)
Assignee: Benjamin Bentmann
> Path normalization during inheritance prohibits usage of properties
> -------------------------------------------------------------------
>
> Key: MNG-3315
> URL: http://jira.codehaus.org/browse/MNG-3315
> Project: Maven 2 & 3
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.8
> Reporter: Benjamin Bentmann
> Assignee: Benjamin Bentmann
> Attachments: project.zip
>
>
> Assume a multi-module scenario with the following (non-standard) directory layout:
> project/
> project-parent/
> project-module-1/
> project-module-2/
> That is, the parent POM is placed in a sibling directory rather than the parent directory of the module projects such that the "module path adjustment" is "../" when inheriting paths/URLs from the project-parent.
> Now, consider the following POM snippet for the site distribution (or any other element where Maven adjusts paths for sub modules):
> {code:xml}
> <site>
> <id>website</id>
> <url>dav:http://www.company.org/project</url>
> </site>
> {code}
> All fine so far, but this slightly modified snippet does not work any more:
> {code:xml}
> <properties>
> <site.url>dav:http://www.company.org/project</site.url>
> </properties>
> ...
> <site>
> <id>website</id>
> <url>${site.url}</url>
> </site>
> {code}
> Just replacing the string by a property produces a bad URL for any sub project. This problems originates from DefaultModelInheritanceAssembler.resolvePath() that "normalizes" a string like "${site.url}/../project-module-1" to "project-module-1".
> While the usage of the property is not mandatory, I nevertheless think the moral from this subtle issue should be not to do any path normalization until all properties have been interpolated, i.e.:
> - inheritance ( URL = "${site.url}/../project-module-1" )
> - interpolation ( URL = "dav:http://www.company.org/project/../project-module-1" )
> - path/URL normalization ( URL = "dav:http://www.company.org/project-module-1" )
> Otherwise, Maven calls another weird pitfall its own.
--
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: (MNG-3315) Path normalization during inheritance
prohibits usage of properties
Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-3315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brett Porter updated MNG-3315:
------------------------------
Fix Version/s: 2.0.x
> Path normalization during inheritance prohibits usage of properties
> -------------------------------------------------------------------
>
> Key: MNG-3315
> URL: http://jira.codehaus.org/browse/MNG-3315
> Project: Maven 2
> Issue Type: Bug
> Components: Inheritance and Interpolation
> Affects Versions: 2.0.8
> Reporter: Benjamin Bentmann
> Fix For: 2.0.x
>
> Attachments: project.zip
>
>
> Assume a multi-module scenario with the following (non-standard) directory layout:
> project/
> project-parent/
> project-module-1/
> project-module-2/
> That is, the parent POM is placed in a sibling directory rather than the parent directory of the module projects such that the "module path adjustment" is "../" when inheriting paths/URLs from the project-parent.
> Now, consider the following POM snippet for the site distribution (or any other element where Maven adjusts paths for sub modules):
> {code:xml}
> <site>
> <id>website</id>
> <url>dav:http://www.company.org/project</url>
> </site>
> {code}
> All fine so far, but this slightly modified snippet does not work any more:
> {code:xml}
> <properties>
> <site.url>dav:http://www.company.org/project</site.url>
> </properties>
> ...
> <site>
> <id>website</id>
> <url>${site.url}</url>
> </site>
> {code}
> Just replacing the string by a property produces a bad URL for any sub project. This problems originates from DefaultModelInheritanceAssembler.resolvePath() that "normalizes" a string like "${site.url}/../project-module-1" to "project-module-1".
> While the usage of the property is not mandatory, I nevertheless think the moral from this subtle issue should be not to do any path normalization until all properties have been interpolated, i.e.:
> - inheritance ( URL = "${site.url}/../project-module-1" )
> - interpolation ( URL = "dav:http://www.company.org/project/../project-module-1" )
> - path/URL normalization ( URL = "dav:http://www.company.org/project-module-1" )
> Otherwise, Maven calls another weird pitfall its own.
--
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