From 4256e417b996defea4f69bf430e56b8a254eeb7b Mon Sep 17 00:00:00 2001 From: Britton Isbell Date: Thu, 6 Nov 2008 16:12:17 +0000 Subject: [PATCH] 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 --- .../builder/PomClassicTransformer.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) 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 cbf4f465b6..4b2217b91f 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 @@ -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 )