mirror of https://github.com/apache/maven.git
If DistributionManagement site url contains a property, build was failing. This is a quick fix and will still not return the correct URL. The problem is that interpolation occurs after inheritance and resolving URLs based on a parent is an inheritance issue.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@711888 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3d85fa7874
commit
4256e417b9
|
@ -372,19 +372,22 @@ public final class PomClassicTransformer
|
|||
}
|
||||
|
||||
//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 );
|
||||
if(!siteUrlProperty.getResolvedValue().endsWith("}")) {
|
||||
siteUrl.append( siteUrlProperty.getResolvedValue().substring(0, siteUrlProperty.getResolvedValue().lastIndexOf("/")) );
|
||||
}
|
||||
int index = tmp.indexOf( siteUrlProperty );
|
||||
tmp.remove( index );
|
||||
tmp.add( index, new ModelProperty( ProjectUri.DistributionManagement.Site.url, siteUrl.toString() ) );
|
||||
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() ) );
|
||||
}
|
||||
|
||||
//If DistributionManagement site URL is property,
|
||||
//SCM Rule
|
||||
ModelProperty scmUrlProperty = getPropertyFor( ProjectUri.Scm.url, tmp );
|
||||
if ( scmUrl.length() == 0 && scmUrlProperty != null )
|
||||
|
|
Loading…
Reference in New Issue