Fix for IT 3134.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@711707 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Britton Isbell 2008-11-05 21:46:12 +00:00
parent acc8010f45
commit 824e2eefe7
1 changed files with 15 additions and 0 deletions

View File

@ -252,6 +252,7 @@ public final class PomClassicTransformer
List<ModelProperty> modelProperties = new ArrayList<ModelProperty>();
List<String> projectNames = new ArrayList<String>();
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 )