diff --git a/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicTransformer.java b/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicTransformer.java index 122a5ebfce..59c3b40dc4 100644 --- a/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicTransformer.java +++ b/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicTransformer.java @@ -252,6 +252,7 @@ public final class PomClassicTransformer List modelProperties = new ArrayList(); List projectNames = new ArrayList(); + StringBuffer siteUrl = new StringBuffer(); StringBuffer scmUrl = new StringBuffer(); StringBuffer scmConnectionUrl = new StringBuffer(); StringBuffer scmDeveloperUrl = new StringBuffer(); @@ -372,6 +373,20 @@ public final class PomClassicTransformer tmp.removeAll( removeProperties ); } + //Site Rule + ModelProperty siteUrlProperty = getPropertyFor( ProjectUri.DistributionManagement.Site.url, tmp ); + if ( siteUrl.length() == 0 && siteUrlProperty != null ) + { + siteUrl.append( siteUrlProperty.getResolvedValue().substring(0, siteUrlProperty.getResolvedValue().lastIndexOf("/")) ); + for ( String projectName : projectNames ) + { + siteUrl.append( "/" ).append( projectName ); + } + int index = tmp.indexOf( siteUrlProperty ); + tmp.remove( index ); + tmp.add( index, new ModelProperty( ProjectUri.DistributionManagement.Site.url, siteUrl.toString() ) ); + } + //SCM Rule ModelProperty scmUrlProperty = getPropertyFor( ProjectUri.Scm.url, tmp ); if ( scmUrl.length() == 0 && scmUrlProperty != null )