[MNG-3846: Inherited URLs are not automatically extended with the child's artifactId]

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@757543 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Britton Isbell 2009-03-23 21:06:00 +00:00
parent 1123131b32
commit 81048a856e
3 changed files with 16 additions and 2 deletions

View File

@ -56,6 +56,11 @@ public class DistributionManagementProcessor
{ {
copy( p.getDistributionManagement(), t.getDistributionManagement(), false, c.getArtifactId() ); copy( p.getDistributionManagement(), t.getDistributionManagement(), false, c.getArtifactId() );
} }
else if(t.getDistributionManagement() != null && t.getDistributionManagement().getSite() != null)
{
copySite( t.getDistributionManagement().getSite(), t.getDistributionManagement().getSite(), false, c.getArtifactId() );
// copy( t.getDistributionManagement(), t.getDistributionManagement(), isChildMostSpecialized, c.getArtifactId() );
}
} }
private static void copy( DistributionManagement source, DistributionManagement target, boolean isChild, private static void copy( DistributionManagement source, DistributionManagement target, boolean isChild,
@ -144,11 +149,16 @@ public class DistributionManagementProcessor
{ {
target.setUrl( source.getUrl() ); target.setUrl( source.getUrl() );
} }
else else
{ {
target.setUrl( source.getUrl() + "/" + artifactId ); target.setUrl( source.getUrl() + "/" + artifactId );
} }
} }
else
{
target.setUrl( target.getUrl() + "/" + artifactId );
}
} }
} }

View File

@ -127,6 +127,10 @@ public class ModelProcessor
{ {
t.setUrl( p.getUrl() + t.getArtifactId() ); t.setUrl( p.getUrl() + t.getArtifactId() );
} }
else if (t.getUrl() != null)
{
t.setUrl( t.getUrl() + "/" + t.getArtifactId() );
}
//Dependencies //Dependencies
List<Dependency> deps = new ArrayList<Dependency>(); List<Dependency> deps = new ArrayList<Dependency>();

View File

@ -560,7 +560,7 @@ public class PomConstructionTest
assertEquals( "http://parent.url/download", pom.getValue( "distributionManagement/downloadUrl" ) ); assertEquals( "http://parent.url/download", pom.getValue( "distributionManagement/downloadUrl" ) );
} }
/* FIXME: MNG-3846 /* FIXME: MNG-3846*/
public void testAppendArtifactIdOfParentAndChildToInheritedUrls() public void testAppendArtifactIdOfParentAndChildToInheritedUrls()
throws Exception throws Exception
{ {