Maven 2 & 3

site url inheritance broken for UNC paths

Details

  • Complexity:
    Novice
  • Testcase included:
    yes
  • Patch Submitted:
    Yes
  • Number of attachments :
    2

Description

I have a parent POM that is inherited by multiple projects that specifies site wide default settings.
(e.g)
Parent\pom.xml <--- this is the pom containing the site configuration
Parent\CheckStyleConfig\pom.xml

Part of this is the site deploy

<distributionManagement>
<site>
<id>nds-uk.site</id>
<url>file://///scg-nas.uk.nds.com/maven_sites/${project.groupId}/${project.artifactId}/${project.version}</url>
</site>
</distributionManagement>

running site:deploy on the sub procject results in it using a corrupted version of the url.

build output attached.

Notice the corruption of the original parent file:///// (2 slashes are removed so it tries to deploy to local HDD)

parent (OK 5 slashes) file://///scg-nas.uk.nds.com/maven_sites/com.nds.cab.scg/common-parent/1.0.0.0-SNAPSHOT - Session: Opened
child (bad 3 slashes) file:///scg-nas.uk.nds.com/maven_sites/com.nds.cab.scg/common-checkstyle/1.0.0.0-SNAPSHOT/common-checkstyle - Session: Opened

  1. build.txt
    11/Jun/08 10:25 AM
    2 kB
    James Nord
  2. MNG-3621.patch
    11/Jun/08 1:36 PM
    2 kB
    Benjamin Bentmann

Activity

Hide
Benjamin Bentmann added a comment -

Proposed patch which simply retains a leading double slash. As the unit test shows, this makes UNC paths as constructed by Java (btw, these have only 4 successive slashes on a Sun JRE 1.6.0_04, not 5 as used by the reporter) successfully pass DefaultModelInheritanceAssembler.appendPath().

Show
Benjamin Bentmann added a comment - Proposed patch which simply retains a leading double slash. As the unit test shows, this makes UNC paths as constructed by Java (btw, these have only 4 successive slashes on a Sun JRE 1.6.0_04, not 5 as used by the reporter) successfully pass DefaultModelInheritanceAssembler.appendPath().
Hide
John Casey added a comment -

Pushing to 2.0.11 so we can have a smaller set of high-value issues to target for the next release (2.0.10).

Show
John Casey added a comment - Pushing to 2.0.11 so we can have a smaller set of high-value issues to target for the next release (2.0.10).
Hide
Paul Nyheim added a comment -

I would just like to add an observation to this issue.
In our setup, we have extracted the url to a property in the pom

<properties>
  <distMgtSiteUrl>file:////my.server.com/share</distMgtSiteUrl>
</properties>

and in that case, no path manipulation is done in DefaultModelInheritanceAssembler.appendPath(). as the path passed to it will be the non-interpolated property: {{${distMgtSiteUrl}}}.

Show
Paul Nyheim added a comment - I would just like to add an observation to this issue. In our setup, we have extracted the url to a property in the pom
<properties>
  <distMgtSiteUrl>file:////my.server.com/share</distMgtSiteUrl>
</properties>
and in that case, no path manipulation is done in DefaultModelInheritanceAssembler.appendPath(). as the path passed to it will be the non-interpolated property: {{${distMgtSiteUrl}}}.

People

Vote (2)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: