diff --git a/maven-project-builder/src/main/java/org/apache/maven/project/processor/DistributionManagementProcessor.java b/maven-project-builder/src/main/java/org/apache/maven/project/processor/DistributionManagementProcessor.java index 8c22c7d7a3..f97e4985ac 100644 --- a/maven-project-builder/src/main/java/org/apache/maven/project/processor/DistributionManagementProcessor.java +++ b/maven-project-builder/src/main/java/org/apache/maven/project/processor/DistributionManagementProcessor.java @@ -152,12 +152,12 @@ public class DistributionManagementProcessor else { - target.setUrl( source.getUrl() + "/" + artifactId ); + target.setUrl( source.getUrl() + (source.getUrl().endsWith("/") ? "" : "/") + artifactId ); } } else { - target.setUrl( target.getUrl() + "/" + artifactId ); + target.setUrl( target.getUrl() + (target.getUrl().endsWith("/") ? "" : "/")+ artifactId ); } } diff --git a/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java b/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java index 1a75bf8021..4b476d2a27 100644 --- a/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java +++ b/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java @@ -132,26 +132,25 @@ public class DefaultProfileManager String profileId = (String) entry.getKey(); Profile profile = (Profile) entry.getValue(); - System.out.println("Profile = " + profileId); + boolean shouldAdd = false; if ( profileActivationContext.isExplicitlyActive( profileId ) ) { - System.out.println("AAA: " + profileId); shouldAdd = true; } else if ( isActive( profile, profileActivationContext ) ) - {System.out.println("BBB: " + profileId); + { shouldAdd = true; } if ( !profileActivationContext.isExplicitlyInactive( profileId ) && shouldAdd ) { if ( "pom".equals( profile.getSource() ) ) - {System.out.println("CCCC: " + profileId); + { activeFromPom.add( profile ); } else - {System.out.println("DDDDD: " + profileId); + { activeExternal.add( profile ); } } @@ -159,7 +158,6 @@ public class DefaultProfileManager if ( activeFromPom.isEmpty() ) { - System.out.println("activeFromPom.isEmpty()"); List defaultIds = profileActivationContext.getActiveByDefaultProfileIds(); List deactivatedIds = profileActivationContext.getExplicitlyInactiveProfileIds(); @@ -182,15 +180,13 @@ public class DefaultProfileManager } List allActive = new ArrayList( activeFromPom.size() + activeExternal.size() ); - System.out.println("Active From POM: " + activeFromPom.size() + ": EXTERNAL:" + activeExternal.size()); + // System.out.println("Active From POM: " + activeFromPom.size() + ": EXTERNAL:" + activeExternal.size()); allActive.addAll( activeExternal ); allActive.addAll( activeFromPom ); - System.out.println("All active size: " + allActive.size()); - + List defaults = getDefaultProfiles(allActive); if(defaults.size() < allActive.size()) { - System.out.println("Removing: " + defaults.size()); allActive.removeAll( defaults ); } return allActive; diff --git a/maven-project/src/test/java/org/apache/maven/project/PomConstructionTest.java b/maven-project/src/test/java/org/apache/maven/project/PomConstructionTest.java index eab295da8f..d8d03907b1 100644 --- a/maven-project/src/test/java/org/apache/maven/project/PomConstructionTest.java +++ b/maven-project/src/test/java/org/apache/maven/project/PomConstructionTest.java @@ -907,7 +907,14 @@ public class PomConstructionTest { PomTestWrapper pom = this.buildPom( "profile-module-inheritance/sub", "dist" ); assertEquals(0, ( (List) pom.getValue( "modules" ) ).size()); - + } + + /** MNG-3621 */ + public void testUncPath() + throws Exception + { + PomTestWrapper pom = this.buildPom( "unc-path/sub" ); + assertEquals("file:////host/site/test-child", pom.getValue( "distributionManagement/site/url" )); } public void testPluginConfigurationUsingAttributesWithoutPluginManagement() diff --git a/maven-project/src/test/resources-project-builder/unc-path/pom.xml b/maven-project/src/test/resources-project-builder/unc-path/pom.xml new file mode 100644 index 0000000000..1e9035c487 --- /dev/null +++ b/maven-project/src/test/resources-project-builder/unc-path/pom.xml @@ -0,0 +1,41 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng3621 + test-parent + 1.0-SNAPSHOT + pom + + MNG-3621 :: Parent + Test inheritance of UNC paths + + + child + + + + + site + file:////host/site/ + + + diff --git a/maven-project/src/test/resources-project-builder/unc-path/sub/pom.xml b/maven-project/src/test/resources-project-builder/unc-path/sub/pom.xml new file mode 100644 index 0000000000..fddd8723bd --- /dev/null +++ b/maven-project/src/test/resources-project-builder/unc-path/sub/pom.xml @@ -0,0 +1,57 @@ + + + + + + 4.0.0 + + + org.apache.maven.its.mng3621 + test-parent + 1.0-SNAPSHOT + + test-child + + MNG-3621 :: Child + + + + + org.apache.maven.its.plugins + maven-it-plugin-expression + 2.1-SNAPSHOT + + target/pom.properties + + project/distributionManagement/site/url + + + + + test + validate + + eval + + + + + + + +