Issue Details (XML | Word | Printable)

Key: MNG-3315
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Benjamin Bentmann
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Maven 2

Path normalization during inheritance prohibits usage of properties

Created: 10/Dec/07 10:58 AM   Updated: 12/Jun/08 08:25 PM
Component/s: Inheritance and Interpolation
Affects Version/s: 2.0.8
Fix Version/s: 2.0.x

Time Tracking:
Not Specified

File Attachments: 1. Zip Archive project.zip (1 kB)

Issue Links:
Related
 


 Description  « Hide
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):

<site>
    <id>website</id>
    <url>dav:http://www.company.org/project</url>
  </site>

All fine so far, but this slightly modified snippet does not work any more:

<properties>
    <site.url>dav:http://www.company.org/project</site.url>
  </properties>
  ...
  <site>
    <id>website</id>
    <url>${site.url}</url>
  </site>

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

Otherwise, Maven calls another weird pitfall its own.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Benjamin Bentmann added a comment - 10/Dec/07 11:16 AM
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.