You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2012/12/08 17:43:28 UTC

svn commit: r1418704 - in /maven/release/trunk: maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/ maven-release-manager/src/main/java/org/apache/maven/shared/release/util/ maven-release-manager/src/test/resources/projects/gener...

Author: rfscholte
Date: Sat Dec  8 16:43:26 2012
New Revision: 1418704

URL: http://svn.apache.org/viewvc?rev=1418704&view=rev
Log:
[MRELEASE-808] Can't generate release-pom.xml when custom finalName contains ${project.version} 

Added:
    maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/
    maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/MRELEASE-808/
    maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/MRELEASE-808/pom.xml
    maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/MRELEASE-808/verify.groovy
    maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-basic/
    maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-basic/pom.xml
    maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-basic/verify.groovy
    maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-multimodule/
    maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-multimodule/module/
    maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-multimodule/module/pom.xml
    maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-multimodule/pom.xml
    maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-multimodule/verify.groovy
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/main/java/org/apache/maven/shared/release/phase/GenerateReleasePomsPhase.java
    maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/util/ReleaseUtil.java
    maven/release/trunk/maven-release-manager/src/test/resources/projects/generate-release-poms/pom-with-finalname/expected-release-pom.xml
    maven/release/trunk/maven-release-plugin/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?rev=1418704&r1=1418703&r2=1418704&view=diff
==============================================================================
--- 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 Sat Dec  8 16:43:26 2012
@@ -498,7 +498,7 @@ public abstract class AbstractRewritePom
                     continue;
                 }
             }
-            String groupId = interpolate( groupIdElement.getTextTrim(), projectModel );
+            String groupId = ReleaseUtil.interpolate( groupIdElement.getTextTrim(), projectModel );
 
             Element artifactIdElement = element.getChild( "artifactId", element.getNamespace() );
             if ( artifactIdElement == null )
@@ -506,7 +506,7 @@ public abstract class AbstractRewritePom
                 // incomplete element
                 continue;
             }
-            String artifactId = interpolate( artifactIdElement.getTextTrim(), projectModel);
+            String artifactId = ReleaseUtil.interpolate( artifactIdElement.getTextTrim(), projectModel);
 
             String key = ArtifactUtils.versionlessKey( groupId, artifactId );
             String resolvedSnapshotVersion = getResolvedSnapshotVersion( key, resolvedSnapshotDependencies );
@@ -613,30 +613,6 @@ public abstract class AbstractRewritePom
         }
     }
 
-    private String interpolate( String value, Model model )
-        throws ReleaseExecutionException
-    {
-        if ( value != null && value.contains( "${" ) )
-        {
-            StringSearchInterpolator interpolator = new StringSearchInterpolator();
-            List<String> pomPrefixes = Arrays.asList( "pom.", "project." );
-            interpolator.addValueSource( new PrefixedObjectValueSource( pomPrefixes, model, false ) );
-            interpolator.addValueSource( new MapBasedValueSource( model.getProperties() ) );
-            interpolator.addValueSource( new ObjectBasedValueSource( model ) );
-            try
-            {
-                value = interpolator.interpolate( value, new PrefixAwareRecursionInterceptor( pomPrefixes ) );
-            }
-            catch ( InterpolationException e )
-            {
-                throw new ReleaseExecutionException(
-                                                     "Failed to interpolate " + value + " for project " + model.getId(),
-                                                     e );
-            }
-        }
-        return value;
-    }
-
     private void writePom( File pomFile, Document document, ReleaseDescriptor releaseDescriptor, String modelVersion,
                            String intro, String outtro, ScmRepository repository, ScmProvider provider )
         throws ReleaseExecutionException, ReleaseScmCommandException

Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/GenerateReleasePomsPhase.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/GenerateReleasePomsPhase.java?rev=1418704&r1=1418703&r2=1418704&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/GenerateReleasePomsPhase.java (original)
+++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/GenerateReleasePomsPhase.java Sat Dec  8 16:43:26 2012
@@ -68,6 +68,8 @@ import org.codehaus.plexus.util.WriterFa
 public class GenerateReleasePomsPhase
     extends AbstractReleasePomsPhase
 {
+    private static final String FINALNAME_EXPRESSION = "${project.artifactId}-${project.version}";
+
     /**
      *
      *
@@ -232,17 +234,26 @@ public class GenerateReleasePomsPhase
         releaseModel.setVersion( releaseVersion );
 
         // update final name if implicit
-        String finalName = releaseModel.getBuild().getFinalName();
-
-        if ( finalName.equals( releaseModel.getArtifactId() + "-" + projectVersion ) )
-        {
-            releaseModel.getBuild().setFinalName( null );
-        }
-        else if ( finalName.indexOf( Artifact.SNAPSHOT_VERSION ) != -1 )
+        if ( !FINALNAME_EXPRESSION.equals( releaseModel.getBuild().getFinalName() ) )
         {
-            throw new ReleaseFailureException( "Cannot reliably adjust the finalName of project: "
-                            + releaseProject.getId() );
-        }
+            String originalFinalName = findOriginalFinalName( releaseProject );
+            
+            if( originalFinalName == null )
+            {
+                // as defined in super-pom
+                originalFinalName = FINALNAME_EXPRESSION;
+            }
+            String finalName = ReleaseUtil.interpolate( originalFinalName, releaseModel );
+            
+            // still required?
+            if ( finalName.indexOf( Artifact.SNAPSHOT_VERSION ) != -1 )
+            {
+                throw new ReleaseFailureException( "Cannot reliably adjust the finalName of project: "
+                                + releaseProject.getId() );
+            }
+            
+            releaseModel.getBuild().setFinalName( finalName );
+        }        
 
         // update scm
         Scm scm = releaseModel.getScm();
@@ -284,6 +295,23 @@ public class GenerateReleasePomsPhase
 
         return releaseModel;
     }
+    
+    // finalName is inherited
+    private String findOriginalFinalName( MavenProject project )
+    {
+        if ( project.getOriginalModel().getBuild() != null && project.getOriginalModel().getBuild().getFinalName() != null )
+        {
+            return project.getOriginalModel().getBuild().getFinalName();
+        }
+        else if( project.hasParent() )
+        {
+            return findOriginalFinalName( project.getParent() );
+        }
+        else
+        {
+            return null;
+        }
+    }
 
     public ReleaseResult simulate( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
                                    List<MavenProject> reactorProjects )

Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/util/ReleaseUtil.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/util/ReleaseUtil.java?rev=1418704&r1=1418703&r2=1418704&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/util/ReleaseUtil.java (original)
+++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/util/ReleaseUtil.java Sat Dec  8 16:43:26 2012
@@ -22,13 +22,21 @@ package org.apache.maven.shared.release.
 import java.io.File;
 import java.io.IOException;
 import java.io.Reader;
+import java.util.Arrays;
 import java.util.List;
 import java.util.Locale;
 
 import org.apache.commons.lang.StringUtils;
+import org.apache.maven.model.Model;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.shared.release.ReleaseExecutionException;
 import org.apache.maven.shared.release.config.ReleaseDescriptor;
+import org.codehaus.plexus.interpolation.InterpolationException;
+import org.codehaus.plexus.interpolation.MapBasedValueSource;
+import org.codehaus.plexus.interpolation.ObjectBasedValueSource;
+import org.codehaus.plexus.interpolation.PrefixAwareRecursionInterceptor;
+import org.codehaus.plexus.interpolation.PrefixedObjectValueSource;
+import org.codehaus.plexus.interpolation.StringSearchInterpolator;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.IOUtil;
 import org.codehaus.plexus.util.ReaderFactory;
@@ -114,7 +122,7 @@ public class ReleaseUtil
      * Gets the string contents of the specified XML file. Note: In contrast to an XML processor, the line separators in
      * the returned string will be normalized to use the platform's native line separator. This is basically to save
      * another normalization step when writing the string contents back to an XML file.
-     *
+     * 
      * @param file The path to the XML file to read in, must not be <code>null</code>.
      * @return The string contents of the XML file.
      * @throws IOException If the file could not be opened/read.
@@ -142,10 +150,10 @@ public class ReleaseUtil
 
     /**
      * Normalizes the line separators in the specified string.
-     *
-     * @param text      The string to normalize, may be <code>null</code>.
+     * 
+     * @param text The string to normalize, may be <code>null</code>.
      * @param separator The line separator to use for normalization, typically "\n" or "\r\n", must not be
-     *                  <code>null</code>.
+     *            <code>null</code>.
      * @return The input string with normalized line separators or <code>null</code> if the string was <code>null</code>
      *         .
      */
@@ -175,8 +183,7 @@ public class ReleaseUtil
         }
 
         int parentLevels =
-            getBaseWorkingDirectoryParentCount( basedir,
-                                                FileUtils.normalize( releaseDescriptor.getWorkingDirectory() ) );
+            getBaseWorkingDirectoryParentCount( basedir, FileUtils.normalize( releaseDescriptor.getWorkingDirectory() ) );
 
         String url = releaseDescriptor.getScmSourceUrl();
         url = realignScmUrl( parentLevels, url );
@@ -283,4 +290,28 @@ public class ReleaseUtil
     {
         return !file.getAbsolutePath().equals( file.getCanonicalPath() );
     }
+
+    public static String interpolate( String value, Model model )
+        throws ReleaseExecutionException
+    {
+        if ( value != null && value.contains( "${" ) )
+        {
+            StringSearchInterpolator interpolator = new StringSearchInterpolator();
+            List<String> pomPrefixes = Arrays.asList( "pom.", "project." );
+            interpolator.addValueSource( new PrefixedObjectValueSource( pomPrefixes, model, false ) );
+            interpolator.addValueSource( new MapBasedValueSource( model.getProperties() ) );
+            interpolator.addValueSource( new ObjectBasedValueSource( model ) );
+            try
+            {
+                value = interpolator.interpolate( value, new PrefixAwareRecursionInterceptor( pomPrefixes ) );
+            }
+            catch ( InterpolationException e )
+            {
+                throw new ReleaseExecutionException(
+                                                     "Failed to interpolate " + value + " for project " + model.getId(),
+                                                     e );
+            }
+        }
+        return value;
+    }
 }

Modified: maven/release/trunk/maven-release-manager/src/test/resources/projects/generate-release-poms/pom-with-finalname/expected-release-pom.xml
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/test/resources/projects/generate-release-poms/pom-with-finalname/expected-release-pom.xml?rev=1418704&r1=1418703&r2=1418704&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/test/resources/projects/generate-release-poms/pom-with-finalname/expected-release-pom.xml (original)
+++ maven/release/trunk/maven-release-manager/src/test/resources/projects/generate-release-poms/pom-with-finalname/expected-release-pom.xml Sat Dec  8 16:43:26 2012
@@ -27,7 +27,7 @@
       </testResource>
     </testResources>
     <directory>${project.basedir}/target</directory>
-    <finalName>${project.groupId}.${project.artifactId}-${project.version}</finalName>
+    <finalName>groupId.artifactId-1.0</finalName>
   </build>
   <repositories>
     <repository>

Modified: maven/release/trunk/maven-release-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/pom.xml?rev=1418704&r1=1418703&r2=1418704&view=diff
==============================================================================
--- maven/release/trunk/maven-release-plugin/pom.xml (original)
+++ maven/release/trunk/maven-release-plugin/pom.xml Sat Dec  8 16:43:26 2012
@@ -242,6 +242,22 @@
                 </goals>
               </execution>
               <execution>
+                <id>integration-test-prepare-with-pom</id>
+                <configuration>
+                  <pomIncludes>
+                    <pomInclude>projects/prepare-with-pom/*/*pom.xml</pomInclude>
+                  </pomIncludes>
+                  <goals>
+                    <goal>clean</goal>
+                    <goal>${project.groupId}:${project.artifactId}:${project.version}:clean</goal>
+                    <goal>${project.groupId}:${project.artifactId}:${project.version}:prepare-with-pom</goal>
+                  </goals>
+                </configuration>
+                <goals>
+                  <goal>run</goal>
+                </goals>
+              </execution>
+              <execution>
                 <id>integration-test-branch</id>
                 <configuration>
                   <pomIncludes>

Added: maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/MRELEASE-808/pom.xml
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/MRELEASE-808/pom.xml?rev=1418704&view=auto
==============================================================================
--- maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/MRELEASE-808/pom.xml (added)
+++ maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/MRELEASE-808/pom.xml Sat Dec  8 16:43:26 2012
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- ~ Licensed to the Apache Software Foundation (ASF) under one ~ or more 
+  contributor license agreements. See the NOTICE file ~ distributed with this 
+  work for additional information ~ regarding copyright ownership. The ASF 
+  licenses this file ~ to you under the Apache License, Version 2.0 (the ~ 
+  "License"); you may not use this file except in compliance ~ with the License. 
+  You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 
+  ~ ~ Unless required by applicable law or agreed to in writing, ~ software 
+  distributed under the License is distributed on an ~ "AS IS" BASIS, WITHOUT 
+  WARRANTIES OR CONDITIONS OF ANY ~ KIND, either express or implied. See the 
+  License for the ~ specific language governing permissions and limitations 
+  ~ under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.plugin.release.its</groupId>
+  <artifactId>mrelease-808</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  
+  <scm>
+    <connection>scm:dummy|nul</connection>
+    <developerConnection>scm:dummy|nul</developerConnection>
+     <url>http://${scm.host}/viewvc/${project.artifactId}/trunk/</url>
+  </scm>
+  
+  <properties>
+    <scm.host>localhost:8080</scm.host>
+  </properties>
+
+  <distributionManagement>
+    <snapshotRepository>
+      <id>dummy</id>
+      <url>dummy:nul</url>
+    </snapshotRepository>
+  </distributionManagement>
+
+  <build>
+    <finalName>${project.groupId}.${project.artifactId}-${project.version}</finalName>
+    <extensions>
+      <extension>
+        <groupId>org.apache.maven.its.release</groupId>
+        <artifactId>wagon-provider-dummy</artifactId>
+        <version>1.0</version>
+      </extension>
+    </extensions>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-release-plugin</artifactId>
+        <version>@project.version@</version>
+        <dependencies>
+          <dependency>
+            <groupId>org.apache.maven.its.release</groupId>
+            <artifactId>maven-scm-provider-dummy</artifactId>
+            <version>1.0</version>
+          </dependency>
+        </dependencies>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>
\ No newline at end of file

Added: maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/MRELEASE-808/verify.groovy
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/MRELEASE-808/verify.groovy?rev=1418704&view=auto
==============================================================================
--- maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/MRELEASE-808/verify.groovy (added)
+++ maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/MRELEASE-808/verify.groovy Sat Dec  8 16:43:26 2012
@@ -0,0 +1,24 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+File releasePom = new File( basedir, 'release-pom.xml' )
+assert releasePom.exists()
+
+assert 1 == releasePom.getText().count("<finalName>org.apache.maven.plugin.release.its.mrelease-808-1.0</finalName>")

Added: maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-basic/pom.xml
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-basic/pom.xml?rev=1418704&view=auto
==============================================================================
--- maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-basic/pom.xml (added)
+++ maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-basic/pom.xml Sat Dec  8 16:43:26 2012
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- ~ Licensed to the Apache Software Foundation (ASF) under one ~ or more 
+  contributor license agreements. See the NOTICE file ~ distributed with this 
+  work for additional information ~ regarding copyright ownership. The ASF 
+  licenses this file ~ to you under the Apache License, Version 2.0 (the ~ 
+  "License"); you may not use this file except in compliance ~ with the License. 
+  You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 
+  ~ ~ Unless required by applicable law or agreed to in writing, ~ software 
+  distributed under the License is distributed on an ~ "AS IS" BASIS, WITHOUT 
+  WARRANTIES OR CONDITIONS OF ANY ~ KIND, either express or implied. See the 
+  License for the ~ specific language governing permissions and limitations 
+  ~ under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.plugin.release.its</groupId>
+  <artifactId>finalname-basic</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  
+  <scm>
+    <connection>scm:dummy|nul</connection>
+    <developerConnection>scm:dummy|nul</developerConnection>
+     <url>http://${scm.host}/viewvc/${project.artifactId}/trunk/</url>
+  </scm>
+  
+  <properties>
+    <scm.host>localhost:8080</scm.host>
+  </properties>
+
+  <distributionManagement>
+    <snapshotRepository>
+      <id>dummy</id>
+      <url>dummy:nul</url>
+    </snapshotRepository>
+  </distributionManagement>
+
+  <build>
+    <extensions>
+      <extension>
+        <groupId>org.apache.maven.its.release</groupId>
+        <artifactId>wagon-provider-dummy</artifactId>
+        <version>1.0</version>
+      </extension>
+    </extensions>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-release-plugin</artifactId>
+        <version>@project.version@</version>
+        <dependencies>
+          <dependency>
+            <groupId>org.apache.maven.its.release</groupId>
+            <artifactId>maven-scm-provider-dummy</artifactId>
+            <version>1.0</version>
+          </dependency>
+        </dependencies>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>
\ No newline at end of file

Added: maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-basic/verify.groovy
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-basic/verify.groovy?rev=1418704&view=auto
==============================================================================
--- maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-basic/verify.groovy (added)
+++ maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-basic/verify.groovy Sat Dec  8 16:43:26 2012
@@ -0,0 +1,24 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+File releasePom = new File( basedir, 'release-pom.xml' )
+assert releasePom.exists()
+
+assert 1 == releasePom.getText().count("<finalName>finalname-basic-1.0</finalName>")

Added: maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-multimodule/module/pom.xml
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-multimodule/module/pom.xml?rev=1418704&view=auto
==============================================================================
--- maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-multimodule/module/pom.xml (added)
+++ maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-multimodule/module/pom.xml Sat Dec  8 16:43:26 2012
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- ~ Licensed to the Apache Software Foundation (ASF) under one ~ or more 
+  contributor license agreements. See the NOTICE file ~ distributed with this 
+  work for additional information ~ regarding copyright ownership. The ASF 
+  licenses this file ~ to you under the Apache License, Version 2.0 (the ~ 
+  "License"); you may not use this file except in compliance ~ with the License. 
+  You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 
+  ~ ~ Unless required by applicable law or agreed to in writing, ~ software 
+  distributed under the License is distributed on an ~ "AS IS" BASIS, WITHOUT 
+  WARRANTIES OR CONDITIONS OF ANY ~ KIND, either express or implied. See the 
+  License for the ~ specific language governing permissions and limitations 
+  ~ under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  
+  <parent>
+    <groupId>org.apache.maven.plugin.release.its</groupId>
+    <artifactId>finalname-multimodule</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  
+  <artifactId>module</artifactId>
+
+</project>
\ No newline at end of file

Added: maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-multimodule/pom.xml
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-multimodule/pom.xml?rev=1418704&view=auto
==============================================================================
--- maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-multimodule/pom.xml (added)
+++ maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-multimodule/pom.xml Sat Dec  8 16:43:26 2012
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- ~ Licensed to the Apache Software Foundation (ASF) under one ~ or more 
+  contributor license agreements. See the NOTICE file ~ distributed with this 
+  work for additional information ~ regarding copyright ownership. The ASF 
+  licenses this file ~ to you under the Apache License, Version 2.0 (the ~ 
+  "License"); you may not use this file except in compliance ~ with the License. 
+  You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 
+  ~ ~ Unless required by applicable law or agreed to in writing, ~ software 
+  distributed under the License is distributed on an ~ "AS IS" BASIS, WITHOUT 
+  WARRANTIES OR CONDITIONS OF ANY ~ KIND, either express or implied. See the 
+  License for the ~ specific language governing permissions and limitations 
+  ~ under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.plugin.release.its</groupId>
+  <artifactId>finalname-multimodule</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  
+  <scm>
+    <connection>scm:dummy|nul</connection>
+    <developerConnection>scm:dummy|nul</developerConnection>
+  </scm>
+  
+  <distributionManagement>
+    <snapshotRepository>
+      <id>dummy</id>
+      <url>dummy:nul</url>
+    </snapshotRepository>
+  </distributionManagement>
+
+  <build>
+    <finalName>FinalName</finalName>
+    <extensions>
+      <extension>
+        <groupId>org.apache.maven.its.release</groupId>
+        <artifactId>wagon-provider-dummy</artifactId>
+        <version>1.0</version>
+      </extension>
+    </extensions>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-release-plugin</artifactId>
+        <version>@project.version@</version>
+        <dependencies>
+          <dependency>
+            <groupId>org.apache.maven.its.release</groupId>
+            <artifactId>maven-scm-provider-dummy</artifactId>
+            <version>1.0</version>
+          </dependency>
+        </dependencies>
+      </plugin>
+    </plugins>
+  </build>
+  
+  <modules>
+    <module>module</module>
+  </modules>
+
+</project>
\ No newline at end of file

Added: maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-multimodule/verify.groovy
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-multimodule/verify.groovy?rev=1418704&view=auto
==============================================================================
--- maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-multimodule/verify.groovy (added)
+++ maven/release/trunk/maven-release-plugin/src/it/projects/prepare-with-pom/finalname-multimodule/verify.groovy Sat Dec  8 16:43:26 2012
@@ -0,0 +1,24 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+File moduleReleasePom = new File( basedir, 'module/release-pom.xml' )
+assert moduleReleasePom.exists()
+
+assert 1 == moduleReleasePom.getText().count("<finalName>FinalName</finalName>")