maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r492046 - /maven/components/branches/maven-2.0.x/bootstrap/bootstrap-mini/src/main/java/org/apache/maven/bootstrap/model/ModelReader.java
Date Wed, 03 Jan 2007 05:20:20 GMT
Author: brett
Date: Tue Jan  2 21:20:19 2007
New Revision: 492046

URL: http://svn.apache.org/viewvc?view=rev&rev=492046
Log:
temp fix for old bootstrap's interpolation of new wagon versions

Modified:
    maven/components/branches/maven-2.0.x/bootstrap/bootstrap-mini/src/main/java/org/apache/maven/bootstrap/model/ModelReader.java

Modified: maven/components/branches/maven-2.0.x/bootstrap/bootstrap-mini/src/main/java/org/apache/maven/bootstrap/model/ModelReader.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/bootstrap/bootstrap-mini/src/main/java/org/apache/maven/bootstrap/model/ModelReader.java?view=diff&rev=492046&r1=492045&r2=492046
==============================================================================
--- maven/components/branches/maven-2.0.x/bootstrap/bootstrap-mini/src/main/java/org/apache/maven/bootstrap/model/ModelReader.java
(original)
+++ maven/components/branches/maven-2.0.x/bootstrap/bootstrap-mini/src/main/java/org/apache/maven/bootstrap/model/ModelReader.java
Tue Jan  2 21:20:19 2007
@@ -18,6 +18,7 @@
 
 import org.apache.maven.bootstrap.download.ArtifactResolver;
 import org.apache.maven.bootstrap.util.AbstractReader;
+import org.apache.maven.bootstrap.util.StringUtils;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 
@@ -26,7 +27,9 @@
 import java.io.File;
 import java.io.IOException;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 /**
@@ -325,7 +328,7 @@
             }
             else if ( rawName.equals( "version" ) )
             {
-                currentDependency.setVersion( getBodyText() );
+                currentDependency.setVersion( interpolate( getBodyText() ) );
             }
             else if ( rawName.equals( "jar" ) )
             {
@@ -337,7 +340,7 @@
             }
             else if ( rawName.equals( "groupId" ) )
             {
-                currentDependency.setGroupId( getBodyText() );
+                currentDependency.setGroupId( interpolate( getBodyText() ) );
             }
             else if ( rawName.equals( "artifactId" ) )
             {
@@ -459,4 +462,11 @@
         depth--;
     }
 
+    private String interpolate( String text )
+    {
+        Map map = new HashMap();
+        map.put( "pom.groupId", model.getGroupId() );
+
+        return StringUtils.interpolate( text, map );
+    }
 }



Mime
View raw message