[MDEPLOY-240] - Remove updateReleaseInfo parameter
authorKarl Heinz Marbaise <khmarbaise@apache.org>
Sun, 19 Aug 2018 14:51:38 +0000 (16:51 +0200)
committerKarl Heinz Marbaise <khmarbaise@apache.org>
Sun, 19 Aug 2018 15:06:46 +0000 (17:06 +0200)
 - Removed Tests which rely on updateReleaseInfo
 - Removed the configuration from plugin-config.xml for
   updateReleaseInfo

src/main/java/org/apache/maven/plugins/deploy/AbstractDeployMojo.java
src/main/java/org/apache/maven/plugins/deploy/DeployFileMojo.java
src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java
src/test/java/org/apache/maven/plugins/deploy/DeployMojoTest.java
src/test/resources/unit/basic-deploy-pom/plugin-config.xml
src/test/resources/unit/basic-deploy-scp/plugin-config.xml
src/test/resources/unit/basic-deploy-test/plugin-config.xml
src/test/resources/unit/basic-deploy-with-attached-artifacts/plugin-config.xml

index 77e811f..c0efde1 100644 (file)
@@ -42,12 +42,6 @@ public abstract class AbstractDeployMojo
     private boolean offline;
 
     /**
-     * Parameter used to update the metadata to make the artifact as release.
-     */
-    @Parameter( property = "updateReleaseInfo", defaultValue = "false" )
-    protected boolean updateReleaseInfo;
-
-    /**
      * Parameter used to control how many times a failed deployment will be retried before giving up and failing. If a
      * value outside the range 1-10 is specified it will be pulled to the nearest value within the range 1-10.
      * 
@@ -70,11 +64,6 @@ public abstract class AbstractDeployMojo
         }
     }
 
-    boolean isUpdateReleaseInfo()
-    {
-        return updateReleaseInfo;
-    }
-
     int getRetryFailedDeploymentCount()
     {
         return retryFailedDeploymentCount;
index b79010f..23014bb 100644 (file)
@@ -378,10 +378,6 @@ public class DeployFileMojo
             }
         }
 
-        if ( updateReleaseInfo )
-        {
-            artifact.setRelease( true );
-        }
         artifact.setRepository( deploymentRepository );
 
         if ( sources != null )
index 812b22d..72d672f 100644 (file)
@@ -144,7 +144,6 @@ public class DeployMojo
             // @formatter:off
             ProjectDeployerRequest pdr = new ProjectDeployerRequest()
                 .setProject( project )
-                .setUpdateReleaseInfo( isUpdateReleaseInfo() )
                 .setRetryFailedDeploymentCount( getRetryFailedDeploymentCount() )
                 .setAltReleaseDeploymentRepository( altReleaseDeploymentRepository )
                 .setAltSnapshotDeploymentRepository( altSnapshotDeploymentRepository )
index 4db5b2d..746be91 100644 (file)
@@ -360,44 +360,6 @@ public class DeployMojoTest
         assertEquals( 0, getSizeOfExpectedFiles( fileList, expectedFiles ) );    
     }
 
-    public void testUpdateReleaseParamSetToTrue()
-        throws Exception
-    {
-        File testPom = new File( getBasedir(),
-                                 "target/test-classes/unit/basic-deploy-pom/plugin-config.xml" );
-        mojo = ( DeployMojo ) lookupMojo( "deploy", testPom );
-        
-        MockitoAnnotations.initMocks( this );
-        
-        assertNotNull( mojo );
-        
-        ProjectBuildingRequest buildingRequest = mock ( ProjectBuildingRequest.class );
-        when( session.getProjectBuildingRequest() ).thenReturn( buildingRequest );
-        MavenRepositorySystemSession repositorySession = new MavenRepositorySystemSession();
-        repositorySession.setLocalRepositoryManager( new SimpleLocalRepositoryManager( LOCAL_REPO ) );
-        when( buildingRequest.getRepositorySession() ).thenReturn( repositorySession );
-        
-        boolean updateReleaseInfo = (Boolean) getVariableValueFromObject(mojo, "updateReleaseInfo");
-        
-        assertTrue( updateReleaseInfo );
-        
-        MavenProject project = (MavenProject) getVariableValueFromObject( mojo, "project" );
-
-        setVariableValueToObject( mojo, "reactorProjects", Collections.singletonList( project ) );
-
-        artifact = (DeployArtifactStub) project.getArtifact();
-        
-        artifact.setFile( testPom );
-        
-        ArtifactRepositoryStub repo = getRepoStub( mojo );
-        
-        repo.setAppendToUrl( "basic-deploy-updateReleaseParam" );        
-        
-        mojo.execute();
-        
-        assertTrue( artifact.isRelease() );
-    }
-
     public void testDeployIfArtifactFileIsNull()
         throws Exception
     {
index 1f5ae63..8cf373c 100644 (file)
@@ -32,7 +32,6 @@ under the License.
               <basedir>${basedir}</basedir>
             </deploymentRepository>
           </project>
-          <updateReleaseInfo>true</updateReleaseInfo>
         </configuration>
       </plugin>
     </plugins>
index ffb387a..4b3a9bf 100644 (file)
@@ -30,7 +30,6 @@ under the License.
             <attachedArtifacts />
             <deploymentRepository implementation="org.apache.maven.plugins.deploy.stubs.ArtifactRepositoryStub2" />
           </project>
-          <updateReleaseInfo>false</updateReleaseInfo>
           <deployer implementation="org.apache.maven.plugins.deploy.stubs.ArtifactDeployerStub" />
         </configuration>
       </plugin>
index ae6eeaf..a98749b 100644 (file)
Binary files a/src/test/resources/unit/basic-deploy-test/plugin-config.xml and b/src/test/resources/unit/basic-deploy-test/plugin-config.xml differ
index 39803a4..417c54e 100644 (file)
@@ -34,7 +34,6 @@ under the License.
               <basedir>${basedir}</basedir>
             </deploymentRepository>
           </project>
-          <updateReleaseInfo>true</updateReleaseInfo>
         </configuration>
       </plugin>
     </plugins>