This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch mavenproject2model
in repository https://gitbox.apache.org/repos/asf/maven-release.git


The following commit(s) were added to refs/heads/mavenproject2model by this 
push:
     new 2128ec1  Pom file should be resolved by ReleaseDescriptor, not by 
MavenProject
2128ec1 is described below

commit 2128ec1bc99c803fc29f651eb19a79106f0d5115
Author: rfscholte <rfscho...@apache.org>
AuthorDate: Sun Apr 8 18:31:19 2018 +0200

    Pom file should be resolved by ReleaseDescriptor, not by MavenProject
---
 .../release/phase/AbstractBackupPomsPhase.java     | 10 ++---
 .../release/phase/AbstractRewritePomsPhase.java    | 15 +++++--
 .../release/phase/AbstractScmCommitPhase.java      |  7 ++-
 .../release/phase/CreateBackupPomsPhase.java       | 15 ++++---
 .../release/phase/RestoreBackupPomsPhase.java      |  7 ++-
 .../release/phase/AbstractBackupPomsPhaseTest.java | 18 +++++---
 .../release/phase/AbstractReleaseTestCase.java     |  4 +-
 .../AbstractRewritingReleasePhaseTestCase.java     | 15 ++++---
 .../release/phase/AbstractScmCommitPhaseTest.java  | 52 +++++++++++++++++-----
 .../release/phase/CreateBackupPomsPhaseTest.java   | 12 ++---
 .../release/phase/RestoreBackupPomsPhaseTest.java  |  4 +-
 .../phase/ScmCommitDevelopmentPhaseTest.java       |  7 +++
 .../phase/ScmCommitPreparationPhaseTest.java       | 36 +++++++++------
 13 files changed, 138 insertions(+), 64 deletions(-)

diff --git 
a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractBackupPomsPhase.java
 
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractBackupPomsPhase.java
index 65a63ab..f1c0526 100644
--- 
a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractBackupPomsPhase.java
+++ 
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractBackupPomsPhase.java
@@ -29,16 +29,16 @@ public abstract class AbstractBackupPomsPhase
 {
     private final String backupSuffix = ".releaseBackup";
 
-    protected File getPomBackup( String pomLocation )
+    protected File getPomBackup( File workingDirectory, String pomLocation )
     {
-            return new File( pomLocation + backupSuffix );
+        return new File( workingDirectory, pomLocation + backupSuffix );
     }
 
-    protected void deletePomBackup( String pomLocation )
+    protected void deletePomBackup( File workingDirectory, String pomLocation )
     {
-        File pomBackup = getPomBackup( pomLocation );
+        File pomBackup = getPomBackup( workingDirectory, pomLocation );
 
-        if ( pomBackup != null && pomBackup.exists() )
+        if ( pomBackup.exists() )
         {
             pomBackup.delete();
         }
diff --git 
a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java
 
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java
index e60d1c7..6a99c8a 100644
--- 
a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java
+++ 
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java
@@ -146,11 +146,14 @@ public abstract class AbstractRewritePomsPhase
         {
             for ( MavenProject project : reactorProjects )
             {
-                File pomFile = ReleaseUtil.getStandardPom( project );
+                String projectKey = ArtifactUtils.versionlessKey( 
project.getGroupId(), project.getArtifactId() );
+
+                String pomLocation = releaseDescriptor.getProjectPomFile( 
projectKey );
+                
                 // MRELEASE-273 : if no pom
-                if ( pomFile != null )
+                if ( pomLocation != null )
                 {
-                    File file = new File( pomFile.getParentFile(), 
pomFile.getName() + "." + getPomSuffix() );
+                    File file = new File( 
releaseDescriptor.getWorkingDirectory(), pomLocation + "." + getPomSuffix() );
                     if ( file.exists() )
                     {
                         file.delete();
@@ -181,7 +184,11 @@ public abstract class AbstractRewritePomsPhase
                                    ReleaseResult result )
         throws ReleaseExecutionException, ReleaseFailureException
     {
-        File pomFile = ReleaseUtil.getStandardPom( project );
+        String projectKey = ArtifactUtils.versionlessKey( 
project.getGroupId(), project.getArtifactId() );
+
+        String pomLocation = releaseDescriptor.getProjectPomFile( projectKey );
+
+        File pomFile = new File( releaseDescriptor.getWorkingDirectory(), 
pomLocation );
 
         ModelETLRequest request = new ModelETLRequest();
         request.setLineSeparator( ls );
diff --git 
a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractScmCommitPhase.java
 
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractScmCommitPhase.java
index b36d692..0605fef 100644
--- 
a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractScmCommitPhase.java
+++ 
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractScmCommitPhase.java
@@ -19,6 +19,7 @@ package org.apache.maven.shared.release.phase;
  * under the License.
  */
 
+import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFileSet;
@@ -198,7 +199,11 @@ public abstract class AbstractScmCommitPhase
     {
         List<File> pomFiles = new ArrayList<>();
 
-        pomFiles.add( ReleaseUtil.getStandardPom( project ) );
+        String projectKey = ArtifactUtils.versionlessKey( 
project.getGroupId(), project.getArtifactId() );
+
+        String pomLocation = releaseDescriptor.getProjectPomFile( projectKey );
+
+        pomFiles.add( new File( pomLocation ) );
 
         if ( releaseDescriptor.isGenerateReleasePoms() && 
!releaseDescriptor.isSuppressCommitBeforeTagOrBranch() )
         {
diff --git 
a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CreateBackupPomsPhase.java
 
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CreateBackupPomsPhase.java
index 1b22db1..26e3a92 100644
--- 
a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CreateBackupPomsPhase.java
+++ 
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CreateBackupPomsPhase.java
@@ -19,6 +19,7 @@ package org.apache.maven.shared.release.phase;
  * under the License.
  */
 
+import java.io.File;
 import java.io.IOException;
 import java.util.List;
 
@@ -29,7 +30,6 @@ import 
org.apache.maven.shared.release.ReleaseFailureException;
 import org.apache.maven.shared.release.ReleaseResult;
 import org.apache.maven.shared.release.config.ReleaseDescriptor;
 import org.apache.maven.shared.release.env.ReleaseEnvironment;
-import org.apache.maven.shared.release.util.ReleaseUtil;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.util.FileUtils;
 
@@ -65,11 +65,13 @@ public class CreateBackupPomsPhase
     {
         ReleaseResult result = new ReleaseResult();
 
+        File workingDirectory = new File( 
releaseDescriptor.getWorkingDirectory() ); 
+
         for ( MavenProject project : reactorProjects )
         {
             String versionlessKey = ArtifactUtils.versionlessKey( 
project.getGroupId(), project.getArtifactId() );
 
-            deletePomBackup( releaseDescriptor.getProjectPomFile( 
versionlessKey ) );
+            deletePomBackup( workingDirectory, 
releaseDescriptor.getProjectPomFile( versionlessKey ) );
         }
 
         result.setResultCode( ReleaseResult.SUCCESS );
@@ -91,13 +93,16 @@ public class CreateBackupPomsPhase
         String projectKey = ArtifactUtils.versionlessKey( 
project.getGroupId(), project.getArtifactId() );
         
         String pomLocation = releaseDescriptor.getProjectPomFile( projectKey );
-        
+
+        File workingDirectory = new File( 
releaseDescriptor.getWorkingDirectory() ); 
+
         // delete any existing backup first
-        deletePomBackup( pomLocation );
+        deletePomBackup( workingDirectory, pomLocation );
 
         try
         {
-            FileUtils.copyFile( ReleaseUtil.getStandardPom( project ), 
getPomBackup( pomLocation ) );
+            FileUtils.copyFile( new File( workingDirectory, pomLocation ),
+                                getPomBackup( workingDirectory, pomLocation ) 
);
         }
         catch ( IOException e )
         {
diff --git 
a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RestoreBackupPomsPhase.java
 
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RestoreBackupPomsPhase.java
index 76c0750..6e19493 100644
--- 
a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RestoreBackupPomsPhase.java
+++ 
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RestoreBackupPomsPhase.java
@@ -88,9 +88,11 @@ public class RestoreBackupPomsPhase
     {
         String projectKey = ArtifactUtils.versionlessKey( 
project.getGroupId(), project.getArtifactId() );
         
+        File workingDirectory = new File( 
releaseDescriptor.getWorkingDirectory() );
+        
         String pomLocation = releaseDescriptor.getProjectPomFile( projectKey );
         
-        File pomBackup = getPomBackup( pomLocation );
+        File pomBackup = getPomBackup( workingDirectory, pomLocation );
 
         if ( !pomBackup.exists() )
         {
@@ -137,7 +139,8 @@ public class RestoreBackupPomsPhase
 
         try
         {
-            FileUtils.copyFile( getPomBackup( pomLocation ), new File( 
pomLocation ) );
+            FileUtils.copyFile( getPomBackup( workingDirectory, pomLocation ),
+                                new File( workingDirectory, pomLocation ) );
         }
         catch ( IOException e )
         {
diff --git 
a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractBackupPomsPhaseTest.java
 
b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractBackupPomsPhaseTest.java
index c717a7b..b656565 100644
--- 
a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractBackupPomsPhaseTest.java
+++ 
b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractBackupPomsPhaseTest.java
@@ -31,6 +31,8 @@ import org.apache.maven.shared.release.config.ReleaseUtils;
 import org.codehaus.plexus.util.ReaderFactory;
 
 import java.io.File;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -63,7 +65,9 @@ public abstract class AbstractBackupPomsPhaseTest
     {
         List<MavenProject> reactorProjects = new ArrayList<>();
 
-        File pomFile = new File( projectPath, pomFilename );
+        File workingDirectory = getTestFile( projectPath );
+
+        File pomFile = new File( workingDirectory, pomFilename );
 
         MavenProject mainProject = createMavenProject( pomFile );
 
@@ -71,7 +75,7 @@ public abstract class AbstractBackupPomsPhaseTest
 
         for ( String module : mainProject.getModel().getModules() )
         {
-            File modulePom = new File( projectPath + "/" + module, pomFilename 
);
+            File modulePom = new File( projectPath + "/" + module, pomFilename 
).getAbsoluteFile();
 
             MavenProject subproject = createMavenProject( modulePom );
 
@@ -95,17 +99,21 @@ public abstract class AbstractBackupPomsPhaseTest
         return project;
     }
 
-    protected ReleaseDescriptorBuilder createReleaseDescriptorBuilder( 
List<MavenProject> reactorProjects )
+    protected ReleaseDescriptorBuilder createReleaseDescriptorBuilder( 
List<MavenProject> reactorProjects,
+                                                                       String 
workingDirectory )
     {
+        Path workingPath = Paths.get( workingDirectory ).toAbsolutePath();
+
         ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder();
+        builder.setWorkingDirectory( workingPath.toString() );
         
         for ( MavenProject reactorProject : reactorProjects )
         {
             String projectKey =
                 ArtifactUtils.versionlessKey( reactorProject.getGroupId(), 
reactorProject.getArtifactId() );
             
-            // would normally be relative to workingdirectory
-            builder.addProjectPomFile( projectKey, 
reactorProject.getFile().getAbsolutePath() );
+            Path pomPath = reactorProject.getFile().toPath();
+            builder.addProjectPomFile( projectKey, workingPath.relativize( 
pomPath ).toString() );
         }
         
         return builder;
diff --git 
a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractReleaseTestCase.java
 
b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractReleaseTestCase.java
index 2ddee24..ef7713d 100644
--- 
a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractReleaseTestCase.java
+++ 
b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractReleaseTestCase.java
@@ -114,7 +114,9 @@ public abstract class AbstractReleaseTestCase
         ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder();
         for ( MavenProject project : reactorProjects )
         {
-            builder.putOriginalVersion( project.getGroupId() + ':' + 
project.getArtifactId(), project.getVersion() );
+            String projectKey = ArtifactUtils.versionlessKey( 
project.getGroupId(), project.getArtifactId() );
+            builder.putOriginalVersion( projectKey, project.getVersion() );
+            builder.addProjectPomFile( projectKey, project.getFile().getPath() 
);
         }
         return builder;
     }
diff --git 
a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractRewritingReleasePhaseTestCase.java
 
b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractRewritingReleasePhaseTestCase.java
index 46d19a2..ea6cd9f 100644
--- 
a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractRewritingReleasePhaseTestCase.java
+++ 
b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractRewritingReleasePhaseTestCase.java
@@ -27,6 +27,8 @@ import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.verifyNoMoreInteractions;
 
 import java.io.IOException;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -742,13 +744,10 @@ public abstract class 
AbstractRewritingReleasePhaseTestCase
 
     protected ReleaseDescriptorBuilder createDescriptorFromProjects( 
List<MavenProject> reactorProjects, String workingDirectory )
     {
-        ReleaseDescriptorBuilder builder = createDescriptorFromProjects( new 
ReleaseDescriptorBuilder(), reactorProjects );
-        builder.setWorkingDirectory( getWorkingDirectory( workingDirectory 
).toString() );
-        return builder;
-    }
-    
-    private ReleaseDescriptorBuilder createDescriptorFromProjects( 
ReleaseDescriptorBuilder builder, List<MavenProject> reactorProjects )
-    {
+        ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder();
+        Path workingPath = getWorkingDirectory( workingDirectory );
+        builder.setWorkingDirectory( workingPath.toString() );
+        
         if ( reactorProjects.isEmpty() )
         {
             return builder;
@@ -761,6 +760,8 @@ public abstract class AbstractRewritingReleasePhaseTestCase
             String key = project.getGroupId() + ':' + project.getArtifactId();
             builder.putOriginalVersion( key, project.getVersion() );
             builder.addOriginalScmInfo( key, project.getScm() );
+            
+            builder.addProjectPomFile( key, workingPath.relativize( 
project.getFile().toPath() ).toString() );
         }
         
         if ( rootProject.getScm() == null )
diff --git 
a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractScmCommitPhaseTest.java
 
b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractScmCommitPhaseTest.java
index 3a6bbae..3fd8794 100644
--- 
a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractScmCommitPhaseTest.java
+++ 
b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractScmCommitPhaseTest.java
@@ -23,8 +23,10 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
 import java.io.File;
+import java.util.Collections;
 import java.util.List;
 
+import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.model.Model;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.shared.release.config.ReleaseDescriptorBuilder;
@@ -33,14 +35,32 @@ import org.junit.Test;
 
 public class AbstractScmCommitPhaseTest
 {
+    protected ReleaseDescriptorBuilder createReleaseDescriptorBuilder( 
List<MavenProject> reactorProjects )
+    {
+        ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder();
+        
+        for ( MavenProject reactorProject : reactorProjects )
+        {
+            String projectKey =
+                ArtifactUtils.versionlessKey( reactorProject.getGroupId(), 
reactorProject.getArtifactId() );
+            
+            builder.addProjectPomFile( projectKey, 
reactorProject.getFile().getPath() );
+        }
+        
+        return builder;
+    }
+    
     @Test
     public void testDefaultCreatePomFiles()
         throws Exception
     {
+        MavenProject project = createProject( "artifactId", "1.0-SNAPSHOT", 
new File( "pom.xml" ) );
+        
+        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder( 
Collections.singletonList( project ) );
+        
         List<File> files =
-            AbstractScmCommitPhase.createPomFiles( 
ReleaseUtils.buildReleaseDescriptor( new ReleaseDescriptorBuilder() ),
-                                                   createProject( 
"artifactId", "1.0-SNAPSHOT",
-                                                                  new File( 
"pom.xml" ) ) );
+            AbstractScmCommitPhase.createPomFiles( 
ReleaseUtils.buildReleaseDescriptor( builder ), project );
+
         assertEquals( "Number of created files", files.size(), 1 );
         assertTrue( files.contains( new File( "pom.xml" ) ) );
     }
@@ -50,11 +70,14 @@ public class AbstractScmCommitPhaseTest
     public void testCreatePomFilesSuppressCommitBeforeTag()
         throws Exception
     {
-        ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder();
+        MavenProject project = createProject( "artifactId", "1.0-SNAPSHOT", 
new File( "pom.xml" ) );
+                         
+        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder( 
Collections.singletonList( project ) );
         builder.setSuppressCommitBeforeTagOrBranch( true );
+
         List<File> files =
-            AbstractScmCommitPhase.createPomFiles(  
ReleaseUtils.buildReleaseDescriptor( builder ),
-                                                   createProject( 
"artifactId", "1.0-SNAPSHOT", new File( "pom.xml" ) ) );
+            AbstractScmCommitPhase.createPomFiles(  
ReleaseUtils.buildReleaseDescriptor( builder ), project );
+        
         assertEquals( "Number of created files", files.size(), 1 );
         assertTrue( files.contains( new File( "pom.xml" ) ) );
     }
@@ -63,11 +86,14 @@ public class AbstractScmCommitPhaseTest
     public void testCreatePomFilesWithReleasePom()
         throws Exception
     {
-        ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder();
+        MavenProject project = createProject( "artifactId", "1.0-SNAPSHOT", 
new File( "pom.xml" ) );
+        
+        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder( 
Collections.singletonList( project ) );
         builder.setGenerateReleasePoms( true );
+        
         List<File> files =
-            AbstractScmCommitPhase.createPomFiles( 
ReleaseUtils.buildReleaseDescriptor( builder ),
-                                                   createProject( 
"artifactId", "1.0-SNAPSHOT", new File( "pom.xml" ) ) );
+            AbstractScmCommitPhase.createPomFiles( 
ReleaseUtils.buildReleaseDescriptor( builder ), project );
+
         assertEquals( "Number of created files", files.size(), 2 );
         assertTrue( files.contains( new File( "pom.xml" ) ) );
         assertTrue( files.contains( new File( "release-pom.xml" ) ) );
@@ -77,12 +103,14 @@ public class AbstractScmCommitPhaseTest
     public void testCreatePomFilesWithReleasePomAndSuppressCommitBeforeTag()
         throws Exception
     {
-        ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder();
+        MavenProject project = createProject( "artifactId", "1.0-SNAPSHOT", 
new File( "pom.xml" ) );
+
+        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder( 
Collections.singletonList( project ) );
         builder.setGenerateReleasePoms( true );
         builder.setSuppressCommitBeforeTagOrBranch( true );
+        
         List<File> files =
-            AbstractScmCommitPhase.createPomFiles( 
ReleaseUtils.buildReleaseDescriptor( builder ),
-                                                   createProject( 
"artifactId", "1.0-SNAPSHOT", new File( "pom.xml" ) ) );
+            AbstractScmCommitPhase.createPomFiles( 
ReleaseUtils.buildReleaseDescriptor( builder ), project );
         assertEquals( "Number of created files", files.size(), 1 );
         assertTrue( files.contains( new File( "pom.xml" ) ) );
     }
diff --git 
a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/CreateBackupPomsPhaseTest.java
 
b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/CreateBackupPomsPhaseTest.java
index 527d79e..a807771 100644
--- 
a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/CreateBackupPomsPhaseTest.java
+++ 
b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/CreateBackupPomsPhaseTest.java
@@ -80,9 +80,9 @@ public class CreateBackupPomsPhaseTest
     private void runExecuteOnProjects( String path )
         throws Exception
     {
-        List<MavenProject> projects = getReactorProjects( getTestPath( path ) 
);
+        List<MavenProject> projects = getReactorProjects( path );
         
-        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder( 
projects );
+        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder( 
projects, path );
 
         phase.execute( ReleaseUtils.buildReleaseDescriptor( builder ), new 
DefaultReleaseEnvironment(), projects );
 
@@ -92,9 +92,9 @@ public class CreateBackupPomsPhaseTest
     private void runSimulateOnProjects( String path )
         throws Exception
     {
-        List<MavenProject> projects = getReactorProjects( getTestPath( path ) 
);
+        List<MavenProject> projects = getReactorProjects( path );
 
-        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder( 
projects );
+        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder( 
projects, path );
 
         phase.simulate( ReleaseUtils.buildReleaseDescriptor( builder ), new 
DefaultReleaseEnvironment(), projects );
 
@@ -104,9 +104,9 @@ public class CreateBackupPomsPhaseTest
     private void runCleanOnProjects( String path )
         throws Exception
     {
-        List<MavenProject> projects = getReactorProjects( getTestPath( path ) 
);
+        List<MavenProject> projects = getReactorProjects( path );
 
-        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder( 
projects );
+        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder( 
projects, path );
 
         ( (ResourceGenerator) phase ).clean( 
ReleaseUtils.buildReleaseDescriptor( builder ), projects );
 
diff --git 
a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/RestoreBackupPomsPhaseTest.java
 
b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/RestoreBackupPomsPhaseTest.java
index a8418c5..043a437 100644
--- 
a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/RestoreBackupPomsPhaseTest.java
+++ 
b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/RestoreBackupPomsPhaseTest.java
@@ -82,9 +82,9 @@ public class RestoreBackupPomsPhaseTest
     private void runExecuteOnProjects( String path )
         throws Exception
     {
-        List<MavenProject> projects = getReactorProjects( getTestPath( path ) 
);
+        List<MavenProject> projects = getReactorProjects( path );
         
-        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder( 
projects );
+        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder( 
projects, path );
         builder.setScmSourceUrl( "scm:svn:http://myhost/myrepo"; );
         phase.execute( ReleaseUtils.buildReleaseDescriptor( builder ), new 
DefaultReleaseEnvironment(), projects );
 
diff --git 
a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmCommitDevelopmentPhaseTest.java
 
b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmCommitDevelopmentPhaseTest.java
index 41c90f3..255c23a 100644
--- 
a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmCommitDevelopmentPhaseTest.java
+++ 
b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmCommitDevelopmentPhaseTest.java
@@ -32,6 +32,7 @@ import static org.mockito.Mockito.when;
 import java.util.Collections;
 import java.util.List;
 
+import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.scm.ScmFile;
 import org.apache.maven.scm.ScmFileSet;
@@ -80,6 +81,12 @@ public class ScmCommitDevelopmentPhaseTest
         reactorProjects = createReactorProjects();
         rootProject = ReleaseUtil.getRootProject( reactorProjects );
         builder = createReleaseDescriptorBuilder( rootProject );
+        
+        for ( MavenProject project : reactorProjects )
+        {
+            String projectKey = ArtifactUtils.versionlessKey( 
project.getGroupId(), project.getArtifactId() );
+            builder.addProjectPomFile( projectKey, project.getFile().getPath() 
);
+        }
     }
 
     @Test
diff --git 
a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmCommitPreparationPhaseTest.java
 
b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmCommitPreparationPhaseTest.java
index 54c1860..2185894 100644
--- 
a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmCommitPreparationPhaseTest.java
+++ 
b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmCommitPreparationPhaseTest.java
@@ -100,7 +100,8 @@ public class ScmCommitPreparationPhaseTest
     {
         // prepare
         List<MavenProject> reactorProjects = createReactorProjects();
-        ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder();
+
+        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder( 
reactorProjects );
         builder.setScmSourceUrl( "scm-url" );
         MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects 
);
         builder.setWorkingDirectory( 
rootProject.getFile().getParentFile().getAbsolutePath() );
@@ -133,9 +134,10 @@ public class ScmCommitPreparationPhaseTest
         throws Exception
     {
         // prepare
-        ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder();
         String dir = "scm-commit/multiple-poms";
         List<MavenProject> reactorProjects = createReactorProjects( dir, dir, 
null );
+
+        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder( 
reactorProjects );
         builder.setScmSourceUrl( "scm-url" );
         MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects 
);
         builder.setWorkingDirectory( 
rootProject.getFile().getParentFile().getAbsolutePath() );
@@ -175,8 +177,9 @@ public class ScmCommitPreparationPhaseTest
         // prepare
         phase = (ReleasePhase) lookup( ReleasePhase.class, 
"scm-commit-development" );
 
-        ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder();
         List<MavenProject> reactorProjects = createReactorProjects();
+
+        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder( 
reactorProjects );
         builder.setScmSourceUrl( "scm-url" );
         MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects 
);
         builder.setWorkingDirectory( 
rootProject.getFile().getParentFile().getAbsolutePath() );
@@ -193,7 +196,7 @@ public class ScmCommitPreparationPhaseTest
 
         ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.class );
         stub.setScmProvider( scmProviderMock );
-
+        
         // execute
         phase.execute( ReleaseUtils.buildReleaseDescriptor( builder ), new 
DefaultReleaseEnvironment(), reactorProjects );
 
@@ -228,7 +231,8 @@ public class ScmCommitPreparationPhaseTest
     {
         // prepare
         List<MavenProject> reactorProjects = createReactorProjects();
-        ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder();
+        
+        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder( 
reactorProjects );
         builder.setScmSourceUrl( "scm-url" );
         builder.setGenerateReleasePoms( true );
         MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects 
);
@@ -264,8 +268,9 @@ public class ScmCommitPreparationPhaseTest
     public void testSimulateCommit()
         throws Exception
     {
-        ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder();
         List<MavenProject> reactorProjects = createReactorProjects();
+
+        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder( 
reactorProjects );
         builder.setScmSourceUrl( "scm-url" );
         MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects 
);
         builder.setWorkingDirectory( 
rootProject.getFile().getParentFile().getAbsolutePath() );
@@ -306,7 +311,7 @@ public class ScmCommitPreparationPhaseTest
     {
         // prepare
         List<MavenProject> reactorProjects = createReactorProjects();
-        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder();
+        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder( 
reactorProjects );
 
         ScmManagerStub scmManagerStub = (ScmManagerStub) lookup( 
ScmManager.class );
         scmManagerStub.setException( new NoSuchScmProviderException( "..." )  
);
@@ -330,7 +335,7 @@ public class ScmCommitPreparationPhaseTest
     {
         // prepare
         List<MavenProject> reactorProjects = createReactorProjects();
-        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder();
+        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder( 
reactorProjects );
 
         ScmManagerStub scmManagerStub = (ScmManagerStub) lookup( 
ScmManager.class );
         scmManagerStub.setException( new ScmRepositoryException( "..." )  );
@@ -355,7 +360,8 @@ public class ScmCommitPreparationPhaseTest
     {
         // prepare
         List<MavenProject> reactorProjects = createReactorProjects();
-        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder();
+        
+        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder( 
reactorProjects );
 
         ScmProvider scmProviderMock = mock( ScmProvider.class );
         when( scmProviderMock.checkIn( isA( ScmRepository.class ), isA( 
ScmFileSet.class ), isNull( ScmVersion.class ),
@@ -387,7 +393,7 @@ public class ScmCommitPreparationPhaseTest
         throws Exception
     {
         List<MavenProject> reactorProjects = createReactorProjects();
-        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder();
+        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder( 
reactorProjects );
 
         ScmManager scmManager = (ScmManager) lookup( ScmManager.class );
         ScmProviderStub providerStub =
@@ -411,9 +417,9 @@ public class ScmCommitPreparationPhaseTest
     public void testSuppressCommitWithRemoteTaggingFails()
         throws Exception
     {
-        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder();
         List<MavenProject> reactorProjects = createReactorProjects();
 
+        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder( 
reactorProjects );
         builder.setRemoteTagging( true );
         builder.setSuppressCommitBeforeTagOrBranch( true );
 
@@ -441,9 +447,9 @@ public class ScmCommitPreparationPhaseTest
     public void testSuppressCommitAfterBranch()
         throws Exception
     {
-        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder();
         List<MavenProject> reactorProjects = createReactorProjects();
 
+        ReleaseDescriptorBuilder builder = createReleaseDescriptorBuilder( 
reactorProjects );
         builder.setBranchCreation( true );
         builder.setRemoteTagging( false );
         builder.setSuppressCommitBeforeTagOrBranch( true );
@@ -466,12 +472,14 @@ public class ScmCommitPreparationPhaseTest
         return createReactorProjects( dir, dir, null );
     }
 
-    private static ReleaseDescriptorBuilder createReleaseDescriptorBuilder()
+    @Override
+    protected ReleaseDescriptorBuilder createReleaseDescriptorBuilder( 
List<MavenProject> reactorProjects )
     {
-        ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder();
+        ReleaseDescriptorBuilder builder = 
super.createReleaseDescriptorBuilder( reactorProjects );
         builder.setScmSourceUrl( "scm-url" );
         builder.setScmReleaseLabel( "release-label" );
         builder.setWorkingDirectory( getTestFile( "target/test/checkout" 
).getAbsolutePath() );
         return builder;
     }
+
 }
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
rfscho...@apache.org.

Reply via email to