Author: evenisse
Date: Mon May  7 02:55:38 2007
New Revision: 535828

URL: http://svn.apache.org/viewvc?view=rev&rev=535828
Log:
Allow ${version} in dependency versions and ${project.*} in properties

Modified:
    
maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java

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=535828&r1=535827&r2=535828
==============================================================================
--- 
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
 Mon May  7 02:55:38 2007
@@ -517,8 +517,8 @@
                         {
                             versionElement.setText( mappedVersion );
                         }
-                        else
-                        if ( versionText.matches( "\\$\\{project.+\\}" ) || 
versionText.matches( "\\$\\{pom.+\\}" ) )
+                        else if ( versionText.matches( "\\$\\{project.+\\}" ) 
||
+                            versionText.matches( "\\$\\{pom.+\\}" ) || 
"${version}".equals( versionText ) )
                         {
                             logInfo( result, "Ignoring artifact version update 
for expression: " + versionText );
                             //ignore... we cannot update this expression
@@ -539,11 +539,22 @@
                                 }
                                 else if ( !mappedVersion.equals( versionText ) 
)
                                 {
-                                    // the value of the expression conflicts 
with what the user wanted to release
-                                    throw new ReleaseFailureException( "The 
artifact (" + key + ") requires a " +
-                                        "different version (" + mappedVersion 
+ ") than what is found (" +
-                                        propertyValue + ") for the expression 
(" + expression + ") in the " +
-                                        "project (" + projectId + ")." );
+                                    if ( mappedVersion.matches( 
"\\$\\{project.+\\}" ) ||
+                                        mappedVersion.matches( 
"\\$\\{pom.+\\}" ) ||
+                                        "${version}".equals( mappedVersion ) )
+                                    {
+                                        logInfo( result,
+                                                 "Ignoring artifact version 
update for expression: " + mappedVersion );
+                                        //ignore... we cannot update this 
expression
+                                    }
+                                    else
+                                    {
+                                        // the value of the expression 
conflicts with what the user wanted to release
+                                        throw new ReleaseFailureException( 
"The artifact (" + key + ") requires a " +
+                                            "different version (" + 
mappedVersion + ") than what is found (" +
+                                            propertyValue + ") for the 
expression (" + expression + ") in the " +
+                                            "project (" + projectId + ")." );
+                                    }
                                 }
                             }
                             else


Reply via email to