maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rfscho...@apache.org
Subject [maven-release] 06/21: ReleaseRequests should pass ReleaseDescriptorBuilder so ReleaseManager can add stuff
Date Sat, 10 Feb 2018 16:02:54 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit a39b073d8e41a230ef3b1adf63efb2c4b0134343
Author: rfscholte <rfscholte@apache.org>
AuthorDate: Sat Jan 27 16:59:11 2018 +0100

    ReleaseRequests should pass ReleaseDescriptorBuilder so ReleaseManager can add stuff
---
 .../shared/release/AbstractReleaseRequest.java     | 12 ++--
 .../shared/release/DefaultReleaseManager.java      | 26 ++++---
 .../src/main/mdo/release-descriptor.mdo            | 45 ++----------
 .../shared/release/DefaultReleaseManagerTest.java  | 81 +++++++++++-----------
 .../PropertiesReleaseDescriptorStoreTest.java      |  5 +-
 .../release/config/ReleaseDescriptorStoreStub.java |  9 ++-
 .../phase/RewritePomsForReleasePhaseTest.java      |  6 +-
 .../maven/plugins/release/BranchReleaseMojo.java   |  2 +-
 .../maven/plugins/release/CleanReleaseMojo.java    |  2 +-
 .../maven/plugins/release/PerformReleaseMojo.java  |  2 +-
 .../maven/plugins/release/PrepareReleaseMojo.java  |  2 +-
 .../maven/plugins/release/RollbackReleaseMojo.java |  2 +-
 .../maven/plugins/release/UpdateVersionsMojo.java  |  2 +-
 .../plugins/release/CleanReleaseMojoTest.java      |  2 +-
 .../plugins/release/PerformReleaseMojoTest.java    | 18 ++---
 .../plugins/release/PrepareReleaseMojoTest.java    |  2 +-
 .../plugins/release/StageReleaseMojoTest.java      |  4 +-
 17 files changed, 99 insertions(+), 123 deletions(-)

diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/AbstractReleaseRequest.java
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/AbstractReleaseRequest.java
index 8e7070e..470c6c2 100644
--- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/AbstractReleaseRequest.java
+++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/AbstractReleaseRequest.java
@@ -22,7 +22,7 @@ package org.apache.maven.shared.release;
 import java.util.List;
 
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.shared.release.config.ReleaseDescriptor;
+import org.apache.maven.shared.release.config.ReleaseDescriptorBuilder;
 
 /**
  *
@@ -31,7 +31,7 @@ import org.apache.maven.shared.release.config.ReleaseDescriptor;
  */
 public abstract class AbstractReleaseRequest
 {
-    private ReleaseDescriptor releaseDescriptor;
+    private ReleaseDescriptorBuilder releaseDescriptorBuilder;
 
     private List<MavenProject> reactorProjects;
 
@@ -40,17 +40,17 @@ public abstract class AbstractReleaseRequest
     /**
      * @return the releaseDescriptor
      */
-    public ReleaseDescriptor getReleaseDescriptor()
+    public ReleaseDescriptorBuilder getReleaseDescriptorBuilder()
     {
-        return releaseDescriptor;
+        return releaseDescriptorBuilder;
     }
 
     /**
      * @param releaseDescriptor the releaseDescriptor to set
      */
-    public void setReleaseDescriptor( ReleaseDescriptor releaseDescriptor )
+    public void setReleaseDescriptorBuilder( ReleaseDescriptorBuilder releaseDescriptor )
     {
-        this.releaseDescriptor = releaseDescriptor;
+        this.releaseDescriptorBuilder = releaseDescriptor;
     }
 
     /**
diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/DefaultReleaseManager.java
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/DefaultReleaseManager.java
index cdbfa96..622e336 100644
--- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/DefaultReleaseManager.java
+++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/DefaultReleaseManager.java
@@ -102,12 +102,12 @@ public class DefaultReleaseManager
         ReleaseDescriptor config;
         if ( BooleanUtils.isNotFalse( prepareRequest.getResume() ) )
         {
-            config = loadReleaseDescriptor( prepareRequest.getReleaseDescriptor(),
+            config = loadReleaseDescriptor( prepareRequest.getReleaseDescriptorBuilder().build(),
                                             prepareRequest.getReleaseManagerListener() );
         }
         else
         {
-            config = prepareRequest.getReleaseDescriptor();
+            config = prepareRequest.getReleaseDescriptorBuilder().build();
         }
         
         
@@ -198,7 +198,8 @@ public class DefaultReleaseManager
     public void rollback( ReleaseRollbackRequest rollbackRequest )
         throws ReleaseExecutionException, ReleaseFailureException
     {
-        ReleaseDescriptor releaseDescriptor = loadReleaseDescriptor( rollbackRequest.getReleaseDescriptor(),
null );
+        ReleaseDescriptor releaseDescriptor =
+            loadReleaseDescriptor( rollbackRequest.getReleaseDescriptorBuilder().build(),
null );
 
         Strategy releaseStrategy = getStrategy( releaseDescriptor.getReleaseStrategyId()
);
 
@@ -262,8 +263,9 @@ public class DefaultReleaseManager
     private void perform( ReleasePerformRequest performRequest, ReleaseResult result )
         throws ReleaseExecutionException, ReleaseFailureException
     {
-        ReleaseDescriptor releaseDescriptor = loadReleaseDescriptor( performRequest.getReleaseDescriptor(),
-                                                                     performRequest.getReleaseManagerListener()
);
+        ReleaseDescriptor releaseDescriptor =
+            loadReleaseDescriptor( performRequest.getReleaseDescriptorBuilder().build(),
+                                   performRequest.getReleaseManagerListener() );
 
         Strategy releaseStrategy = getStrategy( releaseDescriptor.getReleaseStrategyId()
);
 
@@ -322,8 +324,9 @@ public class DefaultReleaseManager
     public void branch( ReleaseBranchRequest branchRequest )
         throws ReleaseExecutionException, ReleaseFailureException
     {
-        ReleaseDescriptor releaseDescriptor = loadReleaseDescriptor( branchRequest.getReleaseDescriptor(),
-                                                                     branchRequest.getReleaseManagerListener()
);
+        ReleaseDescriptor releaseDescriptor =
+            loadReleaseDescriptor( branchRequest.getReleaseDescriptorBuilder().build(),
+                                   branchRequest.getReleaseManagerListener() );
 
         boolean dryRun = BooleanUtils.isTrue( branchRequest.getDryRun() );
 
@@ -371,8 +374,9 @@ public class DefaultReleaseManager
     public void updateVersions( ReleaseUpdateVersionsRequest updateVersionsRequest )
         throws ReleaseExecutionException, ReleaseFailureException
     {
-        ReleaseDescriptor releaseDescriptor = loadReleaseDescriptor( updateVersionsRequest.getReleaseDescriptor(),
-                                                                   updateVersionsRequest.getReleaseManagerListener()
);
+        ReleaseDescriptor releaseDescriptor =
+            loadReleaseDescriptor( updateVersionsRequest.getReleaseDescriptorBuilder().build(),
+                                   updateVersionsRequest.getReleaseManagerListener() );
 
         Strategy releaseStrategy = getStrategy( releaseDescriptor.getReleaseStrategyId()
);
 
@@ -446,7 +450,7 @@ public class DefaultReleaseManager
     protected void clean( AbstractReleaseRequest releaseRequest  ) throws ReleaseFailureException
     {
         ReleaseCleanRequest cleanRequest = new ReleaseCleanRequest();
-        cleanRequest.setReleaseDescriptor( releaseRequest.getReleaseDescriptor() );
+        cleanRequest.setReleaseDescriptorBuilder( releaseRequest.getReleaseDescriptorBuilder()
);
         cleanRequest.setReleaseManagerListener( releaseRequest.getReleaseManagerListener()
);
         cleanRequest.setReactorProjects( releaseRequest.getReactorProjects() );
 
@@ -460,7 +464,7 @@ public class DefaultReleaseManager
 
         getLogger().info( "Cleaning up after release..." );
 
-        ReleaseDescriptor releaseDescriptor = cleanRequest.getReleaseDescriptor();
+        ReleaseDescriptor releaseDescriptor = cleanRequest.getReleaseDescriptorBuilder().build();
 
         configStore.delete( releaseDescriptor );
 
diff --git a/maven-release-manager/src/main/mdo/release-descriptor.mdo b/maven-release-manager/src/main/mdo/release-descriptor.mdo
index 885b469..53c00a7 100644
--- a/maven-release-manager/src/main/mdo/release-descriptor.mdo
+++ b/maven-release-manager/src/main/mdo/release-descriptor.mdo
@@ -548,7 +548,7 @@
     /**
      * Field projectVersions
      */
-    private java.util.Map<String, ReleaseStageVersions> projectVersions;
+    private java.util.Map<String, ReleaseStageVersions> projectVersions = new java.util.HashMap<>();
     
     /**
      * Field releaseVersions.
@@ -679,44 +679,6 @@
     } //-- void addOriginalScmInfo( String, org.apache.maven.model.Scm )
 
     /**
-     * Map a given snapshot dependency to a specified version from when it is released.
-     *
-     */
-    public void mapResolvedSnapshotDependencies( String artifactName, String releaseVersion,
String developmentVersion )
-    {
-        if ( resolvedSnapshotDependencies == null )
-        {
-            resolvedSnapshotDependencies = new java.util.HashMap<>();
-        }
-        else
-        {
-            assert !resolvedSnapshotDependencies.containsKey( artifactName );
-        }
-
-        ReleaseStageVersions versionsMap = new ReleaseStageVersions();
-
-        versionsMap.setDevelopment( developmentVersion );
-        versionsMap.setRelease( releaseVersion );
-        resolvedSnapshotDependencies.put( artifactName, versionsMap );
-    }
-
-    /**
-     * Map a given project to a specified version from when it is incremented and placed
back into development.
-     *
-     * @param projectId   the project's group and artifact ID
-     * @param nextVersion the version to map to
-     */
-    public void mapDevelopmentVersion( String projectId, String nextVersion )
-    {
-        if ( developmentVersions == null )
-        {
-            developmentVersions = new java.util.HashMap<>();
-        }
-
-        developmentVersions.put( projectId, nextVersion );
-    }
-
-    /**
      * A map of projects to original versions before any transformation.
      */
     private java.util.Map<String, String> originalVersions;
@@ -746,6 +708,11 @@
     {
       return originalVersions.get( projectId ); 
     }
+    
+    public void addOriginalVersion( String projectId, String version )
+    {
+      originalVersions.put( projectId, version );
+    }
 
     /**
      * Retrieve the release version for the resolved snapshot dependency.
diff --git a/maven-release-manager/src/test/java/org/apache/maven/shared/release/DefaultReleaseManagerTest.java
b/maven-release-manager/src/test/java/org/apache/maven/shared/release/DefaultReleaseManagerTest.java
index 61502d0..9ef602e 100644
--- a/maven-release-manager/src/test/java/org/apache/maven/shared/release/DefaultReleaseManagerTest.java
+++ b/maven-release-manager/src/test/java/org/apache/maven/shared/release/DefaultReleaseManagerTest.java
@@ -44,7 +44,6 @@ import org.apache.maven.scm.manager.ScmManagerStub;
 import org.apache.maven.scm.provider.ScmProvider;
 import org.apache.maven.scm.provider.ScmProviderStub;
 import org.apache.maven.scm.repository.ScmRepository;
-import org.apache.maven.shared.release.config.ReleaseDescriptor;
 import org.apache.maven.shared.release.config.ReleaseDescriptorBuilder;
 import org.apache.maven.shared.release.config.ReleaseDescriptorStore;
 import org.apache.maven.shared.release.config.ReleaseDescriptorStoreException;
@@ -81,11 +80,11 @@ public class DefaultReleaseManagerTest
     {
         ReleaseManager releaseManager = lookup( ReleaseManager.class, "test" );
 
-        ReleaseDescriptor releaseDescriptor = configStore.getReleaseConfiguration();
-        releaseDescriptor.setCompletedPhase( null );
+        ReleaseDescriptorBuilder builder = configStore.getReleaseConfiguration();
+        builder.setCompletedPhase( null );
 
         ReleasePrepareRequest prepareRequest = new ReleasePrepareRequest();
-        prepareRequest.setReleaseDescriptor( releaseDescriptor );
+        prepareRequest.setReleaseDescriptorBuilder( builder );
         prepareRequest.setReleaseEnvironment( new DefaultReleaseEnvironment() );
         
         releaseManager.prepare( prepareRequest );
@@ -106,11 +105,11 @@ public class DefaultReleaseManagerTest
     {
         ReleaseManager releaseManager = lookup( ReleaseManager.class, "test" );
 
-        ReleaseDescriptor releaseDescriptor = configStore.getReleaseConfiguration();
-        releaseDescriptor.setCompletedPhase( "step1" );
+        ReleaseDescriptorBuilder builder = configStore.getReleaseConfiguration();
+        builder.setCompletedPhase( "step1" );
 
         ReleasePrepareRequest prepareRequest = new ReleasePrepareRequest();
-        prepareRequest.setReleaseDescriptor( releaseDescriptor );
+        prepareRequest.setReleaseDescriptorBuilder( builder );
         prepareRequest.setReleaseEnvironment( new DefaultReleaseEnvironment() );
         
         releaseManager.prepare( prepareRequest );
@@ -131,11 +130,11 @@ public class DefaultReleaseManagerTest
     {
         ReleaseManager releaseManager = lookup( ReleaseManager.class, "test" );
 
-        ReleaseDescriptor releaseDescriptor = configStore.getReleaseConfiguration();
-        releaseDescriptor.setCompletedPhase( "step1" );
+        ReleaseDescriptorBuilder builder = configStore.getReleaseConfiguration();
+        builder.setCompletedPhase( "step1" );
 
         ReleasePrepareRequest prepareRequest = new ReleasePrepareRequest();
-        prepareRequest.setReleaseDescriptor( releaseDescriptor );
+        prepareRequest.setReleaseDescriptorBuilder( builder );
         prepareRequest.setReleaseEnvironment( new DefaultReleaseEnvironment() );
         prepareRequest.setDryRun( false );
         prepareRequest.setResume( false );
@@ -158,11 +157,11 @@ public class DefaultReleaseManagerTest
     {
         ReleaseManager releaseManager = lookup( ReleaseManager.class, "test" );
 
-        ReleaseDescriptor releaseDescriptor = configStore.getReleaseConfiguration();
-        releaseDescriptor.setCompletedPhase( "step3" );
+        ReleaseDescriptorBuilder builder = configStore.getReleaseConfiguration();
+        builder.setCompletedPhase( "step3" );
         
         ReleasePrepareRequest prepareRequest = new ReleasePrepareRequest();
-        prepareRequest.setReleaseDescriptor( releaseDescriptor );
+        prepareRequest.setReleaseDescriptorBuilder( builder );
         prepareRequest.setReleaseEnvironment( new DefaultReleaseEnvironment() );
 
         releaseManager.prepare( prepareRequest );
@@ -183,11 +182,11 @@ public class DefaultReleaseManagerTest
     {
         ReleaseManager releaseManager = lookup( ReleaseManager.class, "test" );
 
-        ReleaseDescriptor releaseDescriptor = configStore.getReleaseConfiguration();
-        releaseDescriptor.setCompletedPhase( "foo" );
+        ReleaseDescriptorBuilder builder = configStore.getReleaseConfiguration();
+        builder.setCompletedPhase( "foo" );
 
         ReleasePrepareRequest prepareRequest = new ReleasePrepareRequest();
-        prepareRequest.setReleaseDescriptor( releaseDescriptor );
+        prepareRequest.setReleaseDescriptorBuilder( builder );
         prepareRequest.setReleaseEnvironment( new DefaultReleaseEnvironment() );
         
         releaseManager.prepare( prepareRequest );
@@ -208,11 +207,11 @@ public class DefaultReleaseManagerTest
     {
         ReleaseManager releaseManager = lookup( ReleaseManager.class, "test" );
 
-        ReleaseDescriptor releaseDescriptor = configStore.getReleaseConfiguration();
-        releaseDescriptor.setCompletedPhase( null );
+        ReleaseDescriptorBuilder builder = configStore.getReleaseConfiguration();
+        builder.setCompletedPhase( null );
 
         ReleasePrepareRequest prepareRequest = new ReleasePrepareRequest();
-        prepareRequest.setReleaseDescriptor( releaseDescriptor );
+        prepareRequest.setReleaseDescriptorBuilder( builder );
         prepareRequest.setReleaseEnvironment( new DefaultReleaseEnvironment() );
         prepareRequest.setDryRun( true );
         prepareRequest.setResume( true );
@@ -235,11 +234,11 @@ public class DefaultReleaseManagerTest
     {
         ReleaseManager releaseManager = lookup( ReleaseManager.class, "test" );
 
-        ReleaseDescriptor releaseDescriptor = configStore.getReleaseConfiguration();
-        releaseDescriptor.setCompletedPhase( "step1" );
+        ReleaseDescriptorBuilder builder = configStore.getReleaseConfiguration();
+        builder.setCompletedPhase( "step1" );
 
         ReleasePrepareRequest prepareRequest = new ReleasePrepareRequest();
-        prepareRequest.setReleaseDescriptor( releaseDescriptor );
+        prepareRequest.setReleaseDescriptorBuilder( builder );
         prepareRequest.setReleaseEnvironment( new DefaultReleaseEnvironment() );
         prepareRequest.setDryRun( true );
         prepareRequest.setResume( true );
@@ -262,11 +261,11 @@ public class DefaultReleaseManagerTest
     {
         ReleaseManager releaseManager = lookup( ReleaseManager.class, "test" );
 
-        ReleaseDescriptor releaseDescriptor = configStore.getReleaseConfiguration();
-        releaseDescriptor.setCompletedPhase( "step3" );
+        ReleaseDescriptorBuilder builder = configStore.getReleaseConfiguration();
+        builder.setCompletedPhase( "step3" );
 
         ReleasePrepareRequest prepareRequest = new ReleasePrepareRequest();
-        prepareRequest.setReleaseDescriptor( releaseDescriptor );
+        prepareRequest.setReleaseDescriptorBuilder( builder );
         prepareRequest.setReleaseEnvironment( new DefaultReleaseEnvironment() );
         prepareRequest.setDryRun( true );
         prepareRequest.setResume( true );
@@ -289,11 +288,11 @@ public class DefaultReleaseManagerTest
     {
         ReleaseManager releaseManager = lookup( ReleaseManager.class, "test" );
 
-        ReleaseDescriptor releaseDescriptor = configStore.getReleaseConfiguration();
-        releaseDescriptor.setCompletedPhase( "foo" );
+        ReleaseDescriptorBuilder builder = configStore.getReleaseConfiguration();
+        builder.setCompletedPhase( "foo" );
 
         ReleasePrepareRequest prepareRequest = new ReleasePrepareRequest();
-        prepareRequest.setReleaseDescriptor( releaseDescriptor );
+        prepareRequest.setReleaseDescriptorBuilder( builder );
         prepareRequest.setReleaseEnvironment( new DefaultReleaseEnvironment() );
         prepareRequest.setDryRun( true );
         prepareRequest.setResume( true );
@@ -319,7 +318,7 @@ public class DefaultReleaseManagerTest
         ReleasePrepareRequest prepareRequest = new ReleasePrepareRequest();
         ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder();
         builder.setReleaseStrategyId( "foo" );
-        prepareRequest.setReleaseDescriptor( builder.build() );
+        prepareRequest.setReleaseDescriptorBuilder( builder );
         prepareRequest.setReleaseEnvironment( new DefaultReleaseEnvironment() );
         
         try
@@ -349,7 +348,7 @@ public class DefaultReleaseManagerTest
         releaseManager.setConfigStore( configStoreMock );
         
         ReleasePrepareRequest prepareRequest = new ReleasePrepareRequest();
-        prepareRequest.setReleaseDescriptor( builder.build() );
+        prepareRequest.setReleaseDescriptorBuilder( builder );
         prepareRequest.setReleaseEnvironment( new DefaultReleaseEnvironment() );
 
         // execute
@@ -385,7 +384,7 @@ public class DefaultReleaseManagerTest
         releaseManager.setConfigStore( configStoreMock );
         
         ReleasePrepareRequest prepareRequest = new ReleasePrepareRequest();
-        prepareRequest.setReleaseDescriptor( builder.build() );
+        prepareRequest.setReleaseDescriptorBuilder( builder );
         prepareRequest.setReleaseEnvironment( new DefaultReleaseEnvironment() );
         prepareRequest.setDryRun( false );
         prepareRequest.setResume( false );
@@ -422,7 +421,7 @@ public class DefaultReleaseManagerTest
         releaseManager.setConfigStore( configStoreMock );
 
         ReleaseCleanRequest cleanRequest = new ReleaseCleanRequest();
-        cleanRequest.setReleaseDescriptor( builder.build() );
+        cleanRequest.setReleaseDescriptorBuilder( builder );
         
         // execute
         releaseManager.clean( cleanRequest );
@@ -464,7 +463,7 @@ public class DefaultReleaseManagerTest
         builder.setCheckoutDirectory( checkoutDirectory.getAbsolutePath() );
         
         ReleasePerformRequest performRequest = new ReleasePerformRequest();
-        performRequest.setReleaseDescriptor( builder.build() );
+        performRequest.setReleaseDescriptorBuilder( builder );
         performRequest.setReleaseEnvironment( new DefaultReleaseEnvironment() );
         performRequest.setReactorProjects( createReactorProjects() );
 
@@ -489,7 +488,7 @@ public class DefaultReleaseManagerTest
         releaseManager.setConfigStore( configStoreMock );
         
         ReleasePerformRequest performRequest = new ReleasePerformRequest();
-        performRequest.setReleaseDescriptor( builder.build() );
+        performRequest.setReleaseDescriptorBuilder( builder );
         performRequest.setReleaseEnvironment( new DefaultReleaseEnvironment() );
 
         // execute
@@ -525,7 +524,7 @@ public class DefaultReleaseManagerTest
         releaseManager.setConfigStore( configStore );
 
         ReleasePerformRequest performRequest = new ReleasePerformRequest();
-        performRequest.setReleaseDescriptor( builder.build() );
+        performRequest.setReleaseDescriptorBuilder( builder );
         performRequest.setReleaseEnvironment( new DefaultReleaseEnvironment() );
 
         try
@@ -557,7 +556,7 @@ public class DefaultReleaseManagerTest
         ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder();
         builder.setScmSourceUrl( "scm-url" );
         builder.setWorkingDirectory( getTestFile( "target/working-directory" ).getAbsolutePath()
);
-        performRequest.setReleaseDescriptor( builder.build() );
+        performRequest.setReleaseDescriptorBuilder( builder );
 
         ReleaseManager releaseManager = lookup( ReleaseManager.class, "test" );
 
@@ -588,7 +587,7 @@ public class DefaultReleaseManagerTest
         ReleaseManager releaseManager = lookup( ReleaseManager.class, "test" );
 
         ReleasePerformRequest performRequest = new ReleasePerformRequest();
-        performRequest.setReleaseDescriptor( builder.build() );
+        performRequest.setReleaseDescriptorBuilder( builder );
         performRequest.setReleaseEnvironment( new DefaultReleaseEnvironment() );
         
         try
@@ -627,7 +626,7 @@ public class DefaultReleaseManagerTest
         stub.setScmProvider( scmProviderMock );
 
         ReleasePerformRequest performRequest = new ReleasePerformRequest();
-        performRequest.setReleaseDescriptor( builder.build() );
+        performRequest.setReleaseDescriptorBuilder( builder );
         performRequest.setReleaseEnvironment( new DefaultReleaseEnvironment() );
         performRequest.setReactorProjects( createReactorProjects() );
 
@@ -666,7 +665,7 @@ public class DefaultReleaseManagerTest
         providerStub.setCheckOutScmResult( new CheckOutScmResult( "", "", "", false ) );
         
         ReleasePerformRequest performRequest = new ReleasePerformRequest();
-        performRequest.setReleaseDescriptor( builder.build() );
+        performRequest.setReleaseDescriptorBuilder( builder );
         performRequest.setReleaseEnvironment( new DefaultReleaseEnvironment() );
         performRequest.setReactorProjects( createReactorProjects() );
 
@@ -714,7 +713,7 @@ public class DefaultReleaseManagerTest
         ReleaseManager releaseManager = lookup( ReleaseManager.class, "test" );
         
         ReleaseRollbackRequest rollbackRequest = new ReleaseRollbackRequest();
-        rollbackRequest.setReleaseDescriptor( configStore.getReleaseConfiguration() );
+        rollbackRequest.setReleaseDescriptorBuilder( configStore.getReleaseConfiguration()
);
 
         releaseManager.rollback( rollbackRequest );
 
@@ -731,7 +730,7 @@ public class DefaultReleaseManagerTest
         ReleaseManager releaseManager = lookup( ReleaseManager.class, "test" );
         
         ReleaseUpdateVersionsRequest updateVersionsRequest = new ReleaseUpdateVersionsRequest();
-        updateVersionsRequest.setReleaseDescriptor( configStore.getReleaseConfiguration()
);
+        updateVersionsRequest.setReleaseDescriptorBuilder( configStore.getReleaseConfiguration()
);
 
         releaseManager.updateVersions( updateVersionsRequest );
 
diff --git a/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStoreTest.java
b/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStoreTest.java
index 540044b..225aa81 100644
--- a/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStoreTest.java
+++ b/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStoreTest.java
@@ -434,7 +434,10 @@ public class PropertiesReleaseDescriptorStoreTest
         scm.setTag( null );
         scm.setDeveloperConnection( null );
         builder.addOriginalScmInfo( "groupId:artifactId2", scm );
-        builder.build().mapResolvedSnapshotDependencies( "external:artifactId", "1.0", "1.1-SNAPSHOT"
);
+        ReleaseStageVersions versions = new ReleaseStageVersions();
+        versions.setRelease( "1.0" );
+        versions.setDevelopment( "1.1-SNAPSHOT" );
+        builder.build().getResolvedSnapshotDependencies().put( "external:artifactId", versions
);
 
         return builder.build();
     }
diff --git a/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/ReleaseDescriptorStoreStub.java
b/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/ReleaseDescriptorStoreStub.java
index 7470bd2..9d54918 100644
--- a/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/ReleaseDescriptorStoreStub.java
+++ b/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/ReleaseDescriptorStoreStub.java
@@ -30,19 +30,18 @@ public class ReleaseDescriptorStoreStub
     /**
      * The release configuration to use.
      */
-    private ReleaseDescriptor releaseDescriptor = new ReleaseDescriptor();
+    private ReleaseDescriptorBuilder releaseDescriptor = new ReleaseDescriptorBuilder();
 
     @Override
     public ReleaseDescriptor read( ReleaseDescriptor mergeDescriptor )
     {
-        ReleaseUtils.merge( releaseDescriptor, mergeDescriptor );
-        return releaseDescriptor;
+        ReleaseUtils.merge( releaseDescriptor.build(), mergeDescriptor );
+        return releaseDescriptor.build();
     }
 
     @Override
     public void write( ReleaseDescriptor config )
     {
-        this.releaseDescriptor = config;
     }
 
     @Override
@@ -50,7 +49,7 @@ public class ReleaseDescriptorStoreStub
     {
     }
 
-    public ReleaseDescriptor getReleaseConfiguration()
+    public ReleaseDescriptorBuilder getReleaseConfiguration()
     {
         return releaseDescriptor;
     }
diff --git a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/RewritePomsForReleasePhaseTest.java
b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/RewritePomsForReleasePhaseTest.java
index 5e965f0..0abbeae 100644
--- a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/RewritePomsForReleasePhaseTest.java
+++ b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/RewritePomsForReleasePhaseTest.java
@@ -31,6 +31,7 @@ import java.util.Objects;
 
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.shared.release.config.ReleaseDescriptorBuilder;
+import org.apache.maven.shared.release.config.ReleaseStageVersions;
 import org.apache.maven.shared.release.env.DefaultReleaseEnvironment;
 import org.apache.maven.shared.release.util.ReleaseUtil;
 import org.junit.Test;
@@ -447,7 +448,10 @@ public class RewritePomsForReleasePhaseTest
         List<MavenProject> reactorProjects = createReactorProjects( "pom-with-externally-released-parent"
);
 
         ReleaseDescriptorBuilder builder = createDescriptorFromProjects( reactorProjects
);
-        builder.build().mapResolvedSnapshotDependencies( "external:parent-artifactId", "1",
"2-SNAPSHOT" );
+        ReleaseStageVersions versions = new ReleaseStageVersions();
+        versions.setRelease( "1" );
+        versions.setDevelopment( "2-SNAPSHOT" );
+        builder.build().getResolvedSnapshotDependencies().put( "external:parent-artifactId",
versions );
         builder.addReleaseVersion( "groupId:subproject1", ALTERNATIVE_NEXT_VERSION );
 
         phase.execute( builder.build(), new DefaultReleaseEnvironment(), reactorProjects
);
diff --git a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/BranchReleaseMojo.java
b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/BranchReleaseMojo.java
index 4215598..1c894aa 100644
--- a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/BranchReleaseMojo.java
+++ b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/BranchReleaseMojo.java
@@ -264,7 +264,7 @@ public class BranchReleaseMojo
         try
         {
             ReleaseBranchRequest branchRequest = new ReleaseBranchRequest();
-            branchRequest.setReleaseDescriptor( config.build() );
+            branchRequest.setReleaseDescriptorBuilder( config );
             branchRequest.setReleaseEnvironment( getReleaseEnvironment() );
             branchRequest.setReactorProjects( getReactorProjects() );
             branchRequest.setDryRun( dryRun );
diff --git a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/CleanReleaseMojo.java
b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/CleanReleaseMojo.java
index 1d9f7cf..3de5857 100644
--- a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/CleanReleaseMojo.java
+++ b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/CleanReleaseMojo.java
@@ -48,7 +48,7 @@ public class CleanReleaseMojo
         releaseDescriptor.setWorkingDirectory( getBasedir().getAbsolutePath() );
 
         ReleaseCleanRequest cleanRequest = new ReleaseCleanRequest();
-        cleanRequest.setReleaseDescriptor( releaseDescriptor.build() );
+        cleanRequest.setReleaseDescriptorBuilder( releaseDescriptor );
         cleanRequest.setReactorProjects( getReactorProjects() );
         
         try
diff --git a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java
b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java
index 039d710..9abd94f 100644
--- a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java
+++ b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java
@@ -191,7 +191,7 @@ public class PerformReleaseMojo
             releaseDescriptor.setPerformGoals( goals );
 
             ReleasePerformRequest performRequest  = new ReleasePerformRequest();
-            performRequest.setReleaseDescriptor( releaseDescriptor.build() );
+            performRequest.setReleaseDescriptorBuilder( releaseDescriptor );
             performRequest.setReleaseEnvironment( getReleaseEnvironment() );
             performRequest.setReactorProjects( getReactorProjects() );
             performRequest.setDryRun( dryRun );
diff --git a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PrepareReleaseMojo.java
b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PrepareReleaseMojo.java
index a49f985..b128158 100644
--- a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PrepareReleaseMojo.java
+++ b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PrepareReleaseMojo.java
@@ -306,7 +306,7 @@ public class PrepareReleaseMojo
         } );
         
         ReleasePrepareRequest prepareRequest = new ReleasePrepareRequest();
-        prepareRequest.setReleaseDescriptor( config.build() );
+        prepareRequest.setReleaseDescriptorBuilder( config );
         prepareRequest.setReleaseEnvironment( getReleaseEnvironment() );
         prepareRequest.setReactorProjects( getReactorProjects() );
         prepareRequest.setResume( resume );
diff --git a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/RollbackReleaseMojo.java
b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/RollbackReleaseMojo.java
index e2232a6..970dad6 100644
--- a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/RollbackReleaseMojo.java
+++ b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/RollbackReleaseMojo.java
@@ -49,7 +49,7 @@ public class RollbackReleaseMojo
         try
         {
             ReleaseRollbackRequest rollbackRequest = new ReleaseRollbackRequest();
-            rollbackRequest.setReleaseDescriptor( createReleaseDescriptor().build() );
+            rollbackRequest.setReleaseDescriptorBuilder( createReleaseDescriptor() );
             rollbackRequest.setReleaseEnvironment( getReleaseEnvironment() );
             rollbackRequest.setReactorProjects( getReactorProjects()  );
             
diff --git a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/UpdateVersionsMojo.java
b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/UpdateVersionsMojo.java
index 4c540bd..7543e8b 100644
--- a/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/UpdateVersionsMojo.java
+++ b/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/UpdateVersionsMojo.java
@@ -128,7 +128,7 @@ public class UpdateVersionsMojo
         try
         {
             ReleaseUpdateVersionsRequest updateVersionsRequest = new ReleaseUpdateVersionsRequest();
-            updateVersionsRequest.setReleaseDescriptor( config.build() );
+            updateVersionsRequest.setReleaseDescriptorBuilder( config );
             updateVersionsRequest.setReleaseEnvironment( getReleaseEnvironment() );
             updateVersionsRequest.setReactorProjects( getReactorProjects() );
 
diff --git a/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/CleanReleaseMojoTest.java
b/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/CleanReleaseMojoTest.java
index 2a972c3..44e17cf 100644
--- a/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/CleanReleaseMojoTest.java
+++ b/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/CleanReleaseMojoTest.java
@@ -69,7 +69,7 @@ public class CleanReleaseMojoTest
         verify( mock ).clean( request.capture() );
         
         assertEquals( workingDirectory.getAbsolutePath(),
-                      request.getValue().getReleaseDescriptor().getWorkingDirectory() );
+                      request.getValue().getReleaseDescriptorBuilder().build().getWorkingDirectory()
);
         assertEquals( mojo.getReactorProjects(), request.getValue().getReactorProjects()
);
         
         verifyNoMoreInteractions( mock );
diff --git a/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/PerformReleaseMojoTest.java
b/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/PerformReleaseMojoTest.java
index ca26b2c..ea59cfd 100644
--- a/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/PerformReleaseMojoTest.java
+++ b/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/PerformReleaseMojoTest.java
@@ -74,7 +74,7 @@ public class PerformReleaseMojoTest
         // verify
         ArgumentCaptor<ReleasePerformRequest> argument = ArgumentCaptor.forClass(ReleasePerformRequest.class);
         verify( mock ).perform( argument.capture() );
-        assertEquals( builder.build(), argument.getValue().getReleaseDescriptor() );
+        assertEquals( builder.build(), argument.getValue().getReleaseDescriptorBuilder().build()
);
         assertNotNull( argument.getValue().getReleaseEnvironment()  );
         assertNotNull( argument.getValue().getReactorProjects() );
         assertEquals( Boolean.FALSE, argument.getValue().getDryRun() );
@@ -102,7 +102,7 @@ public class PerformReleaseMojoTest
         // verify
         ArgumentCaptor<ReleasePerformRequest> argument = ArgumentCaptor.forClass(ReleasePerformRequest.class);
         verify( mock ).perform( argument.capture() );
-        assertEquals( builder.build(), argument.getValue().getReleaseDescriptor() );
+        assertEquals( builder.build(), argument.getValue().getReleaseDescriptorBuilder().build()
);
         assertNotNull( argument.getValue().getReleaseEnvironment()  );
         assertNotNull( argument.getValue().getReactorProjects() );
         assertEquals( Boolean.FALSE, argument.getValue().getDryRun() );
@@ -136,7 +136,7 @@ public class PerformReleaseMojoTest
         // verify
         ArgumentCaptor<ReleasePerformRequest> argument = ArgumentCaptor.forClass(ReleasePerformRequest.class);
         verify( mock ).perform( argument.capture() );
-        assertEquals( builder.build(), argument.getValue().getReleaseDescriptor() );
+        assertEquals( builder.build(), argument.getValue().getReleaseDescriptorBuilder().build()
);
         assertNotNull( argument.getValue().getReleaseEnvironment()  );
         assertNotNull( argument.getValue().getReactorProjects() );
         assertEquals( Boolean.FALSE, argument.getValue().getDryRun() );
@@ -189,7 +189,7 @@ public class PerformReleaseMojoTest
         // verify
         ArgumentCaptor<ReleasePerformRequest> argument = ArgumentCaptor.forClass(ReleasePerformRequest.class);
         verify( mock ).perform( argument.capture() );
-        assertEquals( builder.build(), argument.getValue().getReleaseDescriptor() );
+        assertEquals( builder.build(), argument.getValue().getReleaseDescriptorBuilder().build()
);
         assertNotNull( argument.getValue().getReleaseEnvironment()  );
         assertNotNull( argument.getValue().getReactorProjects() );
         assertEquals( Boolean.FALSE, argument.getValue().getDryRun() );
@@ -229,7 +229,7 @@ public class PerformReleaseMojoTest
         // verify
         ArgumentCaptor<ReleasePerformRequest> argument = ArgumentCaptor.forClass(ReleasePerformRequest.class);
         verify( mock ).perform( argument.capture() );
-        assertEquals( builder.build(), argument.getValue().getReleaseDescriptor() );
+        assertEquals( builder.build(), argument.getValue().getReleaseDescriptorBuilder().build()
);
         assertNotNull( argument.getValue().getReleaseEnvironment()  );
         assertNotNull( argument.getValue().getReactorProjects() );
         assertEquals( Boolean.FALSE, argument.getValue().getDryRun() );
@@ -258,7 +258,7 @@ public class PerformReleaseMojoTest
         // verify
         ArgumentCaptor<ReleasePerformRequest> argument = ArgumentCaptor.forClass(ReleasePerformRequest.class);
         verify( mock ).perform( argument.capture() );
-        assertEquals( builder.build(), argument.getValue().getReleaseDescriptor() );
+        assertEquals( builder.build(), argument.getValue().getReleaseDescriptorBuilder().build()
);
         assertNotNull( argument.getValue().getReleaseEnvironment()  );
         assertNotNull( argument.getValue().getReactorProjects() );
         assertEquals( Boolean.FALSE, argument.getValue().getDryRun() );
@@ -296,7 +296,7 @@ public class PerformReleaseMojoTest
         // verify
         ArgumentCaptor<ReleasePerformRequest> argument = ArgumentCaptor.forClass(ReleasePerformRequest.class);
         verify( mock ).perform( argument.capture() );
-        assertEquals( builder.build(), argument.getValue().getReleaseDescriptor() );
+        assertEquals( builder.build(), argument.getValue().getReleaseDescriptorBuilder().build()
);
         assertNotNull( argument.getValue().getReleaseEnvironment()  );
         assertNotNull( argument.getValue().getReactorProjects() );
         assertEquals( Boolean.FALSE, argument.getValue().getDryRun() );
@@ -334,7 +334,7 @@ public class PerformReleaseMojoTest
         // verify
         ArgumentCaptor<ReleasePerformRequest> argument = ArgumentCaptor.forClass(ReleasePerformRequest.class);
         verify( mock ).perform( argument.capture() );
-        assertEquals( builder.build(), argument.getValue().getReleaseDescriptor() );
+        assertEquals( builder.build(), argument.getValue().getReleaseDescriptorBuilder().build()
);
         assertNotNull( argument.getValue().getReleaseEnvironment()  );
         assertNotNull( argument.getValue().getReactorProjects() );
         assertEquals( Boolean.FALSE, argument.getValue().getDryRun() );
@@ -362,7 +362,7 @@ public class PerformReleaseMojoTest
         // verify
         ArgumentCaptor<ReleasePerformRequest> argument = ArgumentCaptor.forClass(ReleasePerformRequest.class);
         verify( mock ).perform( argument.capture() );
-        assertEquals( builder.build(), argument.getValue().getReleaseDescriptor() );
+        assertEquals( builder.build(), argument.getValue().getReleaseDescriptorBuilder().build()
);
         assertNotNull( argument.getValue().getReleaseEnvironment()  );
         assertNotNull( argument.getValue().getReactorProjects() );
         assertEquals( Boolean.FALSE, argument.getValue().getDryRun() );
diff --git a/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/PrepareReleaseMojoTest.java
b/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/PrepareReleaseMojoTest.java
index cea9250..b19520a 100644
--- a/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/PrepareReleaseMojoTest.java
+++ b/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/PrepareReleaseMojoTest.java
@@ -89,7 +89,7 @@ public class PrepareReleaseMojoTest
         // verify
         verify( mock ).prepare( prepareRequest.capture() );
         
-        assertThat( prepareRequest.getValue().getReleaseDescriptor(), is( builder.build()
) );
+        assertThat( prepareRequest.getValue().getReleaseDescriptorBuilder().build(), is(
builder.build() ) );
         assertThat( prepareRequest.getValue().getReleaseEnvironment(), is(instanceOf( ReleaseEnvironment.class
) ) );
         assertThat( prepareRequest.getValue().getReactorProjects(), is( notNullValue() )
);
         assertThat( prepareRequest.getValue().getResume(), is( true ) );
diff --git a/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/StageReleaseMojoTest.java
b/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/StageReleaseMojoTest.java
index 4884554..b7c5448 100644
--- a/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/StageReleaseMojoTest.java
+++ b/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/StageReleaseMojoTest.java
@@ -57,7 +57,7 @@ public class StageReleaseMojoTest
         builder.setAdditionalArguments( "-DaltDeploymentRepository=\"staging\"" );
 
         ReleasePerformRequest performRequest = new ReleasePerformRequest();
-        performRequest.setReleaseDescriptor( builder.build() );
+        performRequest.setReleaseDescriptorBuilder( builder );
         performRequest.setReleaseEnvironment( mojo.getReleaseEnvironment() );
         performRequest.setReactorProjects( mojo.getReactorProjects() );
         performRequest.setDryRun( false );
@@ -70,7 +70,7 @@ public class StageReleaseMojoTest
         // verify
         ArgumentCaptor<ReleasePerformRequest> argument = ArgumentCaptor.forClass(ReleasePerformRequest.class);
         verify( mock ).perform( argument.capture() );
-        assertEquals( builder.build(), argument.getValue().getReleaseDescriptor() );
+        assertEquals( builder.build(), argument.getValue().getReleaseDescriptorBuilder().build()
);
         assertNotNull( argument.getValue().getReleaseEnvironment() );
         assertNotNull( argument.getValue().getReactorProjects() );
         assertEquals( Boolean.FALSE, argument.getValue().getDryRun() );

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

Mime
View raw message