rfscholte commented on a change in pull request #28: MRELEASE-985 Override 
snapshot dependencies from command line
URL: https://github.com/apache/maven-release/pull/28#discussion_r281830802
 
 

 ##########
 File path: 
maven-release-manager/src/main/java/org/apache/maven/shared/release/DefaultReleaseManager.java
 ##########
 @@ -107,23 +107,7 @@ private void prepare( ReleasePrepareRequest 
prepareRequest, ReleaseResult result
         final ReleaseDescriptorBuilder builder = 
prepareRequest.getReleaseDescriptorBuilder();
 
         // Create a config containing values from the session properties (ie 
command line properties with cli).
-        ReleaseUtils.copyPropertiesToReleaseDescriptor( 
prepareRequest.getUserProperties(),
-                                        new ReleaseDescriptorBuilder()
-                                        {
-                                            public ReleaseDescriptorBuilder 
addDevelopmentVersion( String key,
-                                                                               
                    String value )
-                                            {
-                                                builder.addDevelopmentVersion( 
key, value );
-                                                return this;
-                                            }
-
-                                            public ReleaseDescriptorBuilder 
addReleaseVersion( String key,
-                                                                               
                String value )
-                                            {
-                                                builder.addReleaseVersion( 
key, value );
-                                                return this;
-                                            };
-                                        } );
+        ReleaseUtils.copyPropertiesToReleaseDescriptor( 
prepareRequest.getUserProperties(), builder );
 
 Review comment:
   original code should be extended with
   
                           @Override
                           public ReleaseDescriptorBuilder 
addDependencyDevelopmentVersion( String dependencyKey,
                                                                                
            String version )
                           {
                               builder.addDependencyDevelopmentVersion( 
dependencyKey,
                                                                        version 
);
                               return this;
                           };
       
                           @Override
                           public ReleaseDescriptorBuilder 
addDependencyReleaseVersion( String dependencyKey,
                                                                                
        String version )
                           {
                               builder.addDependencyReleaseVersion( 
dependencyKey,
                                                                    version );
                               return this;
       
                           };
   
   This way we have full control over the properties we want to allow to be 
overwritten via commandline.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to