continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1372237 - in /continuum/trunk/continuum-release/src: main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java test/java/org/apache/maven/continuum/release/phase/UpdateWorkingCopyPhaseTest.java
Date Mon, 13 Aug 2012 01:41:55 GMT
Author: brett
Date: Mon Aug 13 01:41:55 2012
New Revision: 1372237

URL: http://svn.apache.org/viewvc?rev=1372237&view=rev
Log:
[CONTINUUM-2538] (regression) unable to release using provided parameters

Pass a dummy project instead of null to the release manager

Modified:
    continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
    continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/phase/UpdateWorkingCopyPhaseTest.java

Modified: continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java?rev=1372237&r1=1372236&r2=1372237&view=diff
==============================================================================
--- continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
(original)
+++ continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
Mon Aug 13 01:41:55 2012
@@ -49,6 +49,7 @@ import org.codehaus.plexus.util.dag.Cycl
 
 import java.io.File;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
 /**
@@ -84,16 +85,28 @@ public class PerformReleaseTaskExecutor
 
         repository = performTask.getLocalRepository();
 
-        List reactorProjects = null;
-        MavenProject mavenProject = null;
+        List reactorProjects;
 
         try
         {
-            mavenProject = getMavenProject( performTask );
-            if ( mavenProject != null )
+            if ( !StringUtils.isEmpty( descriptor.getWorkingDirectory() ) )
             {
+                MavenProject mavenProject = getMavenProject( performTask );
                 reactorProjects = getReactorProjects( descriptor, mavenProject );
             }
+            else
+            {
+                //Perform with provided release parameters (CONTINUUM-1541)
+                descriptor.setCheckoutDirectory( performTask.getBuildDirectory().getAbsolutePath()
);
+
+                // Workaround bugs in maven-release-manager 2.1 that require a project even
though it will ultimately
+                // not be used. TODO: check if upgrading will fix, and return to being an
empty list
+                // The project is fake and won't exist in this location
+                MavenProject project = new MavenProject();
+                project.setFile( new File( descriptor.getCheckoutDirectory(), "pom.xml" )
);
+                reactorProjects = Collections.singletonList( project );
+//                reactorProjects = Collections.emptyList();
+            }
         }
         catch ( ContinuumReleaseException e )
         {
@@ -224,13 +237,6 @@ public class PerformReleaseTaskExecutor
     {
         ReleaseDescriptor descriptor = releaseTask.getDescriptor();
 
-        if ( StringUtils.isEmpty( descriptor.getWorkingDirectory() ) )
-        {
-            //Perform with provided release parameters (CONTINUUM-1541)
-            descriptor.setCheckoutDirectory( releaseTask.getBuildDirectory().getAbsolutePath()
);
-            return null;
-        }
-
         MavenProject project;
         try
         {

Modified: continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/phase/UpdateWorkingCopyPhaseTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/phase/UpdateWorkingCopyPhaseTest.java?rev=1372237&r1=1372236&r2=1372237&view=diff
==============================================================================
--- continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/phase/UpdateWorkingCopyPhaseTest.java
(original)
+++ continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/phase/UpdateWorkingCopyPhaseTest.java
Mon Aug 13 01:41:55 2012
@@ -54,7 +54,7 @@ public class UpdateWorkingCopyPhaseTest
 
         File workingDirectory = new File( releaseDescriptor.getWorkingDirectory() );
 
-        // assert no working directory yet
+        FileUtils.deleteDirectory( workingDirectory );
         assertFalse( workingDirectory.exists() );
 
         phase.execute( releaseDescriptor, new Settings(), null );



Mime
View raw message