maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r531916 - in /maven/release/trunk/maven-release-manager/src: main/java/org/apache/maven/shared/release/phase/ test/resources/projects/rewrite-for-release/pom-with-parent-and-properties/subproject2/
Date Tue, 24 Apr 2007 12:58:02 GMT
Author: evenisse
Date: Tue Apr 24 05:58:01 2007
New Revision: 531916

URL: http://svn.apache.org/viewvc?view=rev&rev=531916
Log:
[MRELEASE-147] Allow ${project.groupId} in dependencies groupId

Modified:
    maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java
    maven/release/trunk/maven-release-manager/src/test/resources/projects/rewrite-for-release/pom-with-parent-and-properties/subproject2/expected-pom.xml
    maven/release/trunk/maven-release-manager/src/test/resources/projects/rewrite-for-release/pom-with-parent-and-properties/subproject2/pom.xml

Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java?view=diff&rev=531916&r1=531915&r2=531916
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java
(original)
+++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java
Tue Apr 24 05:58:01 2007
@@ -423,7 +423,20 @@
                 "' and artifactId='" + artifactId + "']" );
         }
 
-        return (Element) xpath.selectSingleNode( dependencyRoot );
+        Element elem = (Element) xpath.selectSingleNode( dependencyRoot );
+
+        //MRELEASE-147
+        if ( elem == null && groupId.indexOf( "${" ) == -1 )
+        {
+            elem = getDependency( "${project.groupId}", artifactId, groupTagName, tagName,
dependencyRoot );
+
+            if ( elem == null )
+            {
+                elem = getDependency( "${pom.groupId}", artifactId, groupTagName, tagName,
dependencyRoot );
+            }
+        }
+
+        return elem;
     }
 
     private void updateDomVersion( String groupId, String artifactId, Map mappedVersions,
@@ -437,7 +450,7 @@
         String resolvedSnapshotVersion = getResolvedSnapshotVersion( key, resolvedSnapshotDepedencies
);
         Object originalVersion = originalVersions.get( key );
 
-        // workaround 
+        // workaround
         if ( originalVersion == null )
         {
             originalVersion = getOriginalResolvedSnapshotVersion( key, resolvedSnapshotDepedencies
);

Modified: maven/release/trunk/maven-release-manager/src/test/resources/projects/rewrite-for-release/pom-with-parent-and-properties/subproject2/expected-pom.xml
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/test/resources/projects/rewrite-for-release/pom-with-parent-and-properties/subproject2/expected-pom.xml?view=diff&rev=531916&r1=531915&r2=531916
==============================================================================
--- maven/release/trunk/maven-release-manager/src/test/resources/projects/rewrite-for-release/pom-with-parent-and-properties/subproject2/expected-pom.xml
(original)
+++ maven/release/trunk/maven-release-manager/src/test/resources/projects/rewrite-for-release/pom-with-parent-and-properties/subproject2/expected-pom.xml
Tue Apr 24 05:58:01 2007
@@ -29,7 +29,7 @@
 
   <dependencies>
     <dependency>
-      <groupId>groupId</groupId>
+      <groupId>${project.groupId}</groupId>
       <artifactId>subproject1</artifactId>
       <version>${module.version}</version>
     </dependency>

Modified: maven/release/trunk/maven-release-manager/src/test/resources/projects/rewrite-for-release/pom-with-parent-and-properties/subproject2/pom.xml
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/test/resources/projects/rewrite-for-release/pom-with-parent-and-properties/subproject2/pom.xml?view=diff&rev=531916&r1=531915&r2=531916
==============================================================================
--- maven/release/trunk/maven-release-manager/src/test/resources/projects/rewrite-for-release/pom-with-parent-and-properties/subproject2/pom.xml
(original)
+++ maven/release/trunk/maven-release-manager/src/test/resources/projects/rewrite-for-release/pom-with-parent-and-properties/subproject2/pom.xml
Tue Apr 24 05:58:01 2007
@@ -29,7 +29,7 @@
 
   <dependencies>
     <dependency>
-      <groupId>groupId</groupId>
+      <groupId>${project.groupId}</groupId>
       <artifactId>subproject1</artifactId>
       <version>${module.version}</version>
     </dependency>



Mime
View raw message