continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r448140 - in /maven/continuum/trunk: continuum-release/ continuum-release/src/main/java/org/apache/maven/continuum/release/executors/ continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/ continuum-release/src/test/java/...
Date Wed, 20 Sep 2006 09:53:21 GMT
Author: evenisse
Date: Wed Sep 20 02:53:20 2006
New Revision: 448140

URL: http://svn.apache.org/viewvc?view=rev&rev=448140
Log:
Merge release-integration branch r.448121

Added:
    maven/continuum/trunk/continuum-webapp/src/main/webapp/releaseResult.jsp   (with props)
Modified:
    maven/continuum/trunk/continuum-release/pom.xml
    maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
    maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PrepareReleaseTaskExecutor.java
    maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java
    maven/continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java
    maven/continuum/trunk/continuum-webapp/pom.xml
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PerformReleaseAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PrepareReleaseAction.java
    maven/continuum/trunk/continuum-webapp/src/main/webapp/performRelease.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/viewReleaseResult.jsp

Modified: maven/continuum/trunk/continuum-release/pom.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-release/pom.xml?view=diff&rev=448140&r1=448139&r2=448140
==============================================================================
--- maven/continuum/trunk/continuum-release/pom.xml (original)
+++ maven/continuum/trunk/continuum-release/pom.xml Wed Sep 20 02:53:20 2006
@@ -16,10 +16,12 @@
     <dependency>
       <groupId>org.apache.maven.continuum</groupId>
       <artifactId>continuum-api</artifactId>
+      <version>1.1-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-project</artifactId>
+      <version>2.0.4</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.plugins</groupId>
@@ -29,13 +31,14 @@
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-taskqueue</artifactId>
+      <version>1.0-alpha-3</version>
     </dependency>
   </dependencies>
   <build>
     <testResources>
       <testResource>
         <directory>src/test/scm</directory>
-        <targetPath>../scm-src</targetPath>
+        <targetPath>scm-src</targetPath>
       </testResource>
     </testResources>
   </build>

Modified: maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java?view=diff&rev=448140&r1=448139&r2=448140
==============================================================================
--- maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
(original)
+++ maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
Wed Sep 20 02:53:20 2006
@@ -38,6 +38,8 @@
     {
         PerformReleaseProjectTask performTask = (PerformReleaseProjectTask) task;
 
+        ReleaseManagerListener listener = performTask.getListener();
+
         ReleaseDescriptor descriptor = performTask.getDescriptor();
 
         Settings settings;
@@ -47,6 +49,14 @@
         }
         catch ( ContinuumReleaseException e )
         {
+            ReleaseResult result = new ReleaseResult();
+
+            result.appendError( e );
+
+            continuumReleaseManager.getReleaseResults().put( performTask.getReleaseId(),
result );
+
+            listener.error( e.getMessage() );
+
             throw new TaskExecutionException( "Failed to build reactor projects.", e );
         }
 
@@ -57,11 +67,17 @@
         }
         catch ( ContinuumReleaseException e )
         {
+            ReleaseResult result = new ReleaseResult();
+
+            result.appendError( e );
+
+            continuumReleaseManager.getReleaseResults().put( performTask.getReleaseId(),
result );
+
+            listener.error( e.getMessage() );
+
             throw new TaskExecutionException( "Failed to build reactor projects.", e );
         }
 
-        ReleaseManagerListener listener = performTask.getListener();
-
         ReleaseResult result =
             releasePluginManager.performWithResult( descriptor, settings, reactorProjects,
                                                     performTask.getBuildDirectory(), performTask.getGoals(),
@@ -69,9 +85,9 @@
 
         if ( result.getResultCode() == ReleaseResult.SUCCESS )
         {
-            continuumReleaseManager.getReleaseResults().put( performTask.getReleaseId(),
result );
-
             continuumReleaseManager.getPreparedReleases().remove( performTask.getReleaseId()
);
         }
+
+        continuumReleaseManager.getReleaseResults().put( performTask.getReleaseId(), result
);
     }
 }

Modified: maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PrepareReleaseTaskExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PrepareReleaseTaskExecutor.java?view=diff&rev=448140&r1=448139&r2=448140
==============================================================================
--- maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PrepareReleaseTaskExecutor.java
(original)
+++ maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PrepareReleaseTaskExecutor.java
Wed Sep 20 02:53:20 2006
@@ -83,9 +83,9 @@
 
         if ( result.getResultCode() == ReleaseResult.SUCCESS )
         {
-            continuumReleaseManager.getReleaseResults().put( prepareTask.getReleaseId(),
result );
-
             continuumReleaseManager.getPreparedReleases().put( prepareTask.getReleaseId(),
descriptor );
         }
+
+        continuumReleaseManager.getReleaseResults().put( prepareTask.getReleaseId(), result
);
     }
 }

Modified: maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java?view=diff&rev=448140&r1=448139&r2=448140
==============================================================================
--- maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java
(original)
+++ maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java
Wed Sep 20 02:53:20 2006
@@ -32,8 +32,6 @@
 
     private ReleaseManagerListener listener;
 
-    private long maxExecutionTime;
-
     public AbstractReleaseProjectTask( String releaseId, ReleaseDescriptor descriptor,
                                        ReleaseManagerListener listener )
     {
@@ -70,15 +68,5 @@
     public void setListener( ReleaseManagerListener listener )
     {
         this.listener = listener;
-    }
-
-    public long getMaxExecutionTime()
-    {
-         return maxExecutionTime;
-    }
-
-    public void setMaxExecutionTime( long maxTime )
-    {
-        this.maxExecutionTime = maxTime;
     }
 }

Modified: maven/continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java?view=diff&rev=448140&r1=448139&r2=448140
==============================================================================
--- maven/continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java
(original)
+++ maven/continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java
Wed Sep 20 02:53:20 2006
@@ -18,7 +18,9 @@
 
 import org.apache.maven.continuum.release.tasks.PrepareReleaseProjectTask;
 import org.apache.maven.continuum.release.tasks.PerformReleaseProjectTask;
+import org.apache.maven.continuum.release.ContinuumReleaseManager;
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
+import org.apache.maven.plugins.release.ReleaseResult;
 import org.apache.maven.scm.manager.NoSuchScmProviderException;
 import org.apache.maven.scm.manager.ScmManager;
 import org.apache.maven.scm.repository.ScmRepository;
@@ -28,6 +30,7 @@
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.taskqueue.Task;
 import org.codehaus.plexus.taskqueue.execution.TaskExecutor;
+import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
 
 import java.io.File;
 
@@ -37,6 +40,8 @@
 public class ReleaseTaskExecutorTest
     extends PlexusTestCase
 {
+    private ContinuumReleaseManager releaseManager;
+
     private ScmManager scmManager;
 
     private TaskExecutor prepareExec;
@@ -62,12 +67,17 @@
         {
             performExec = (TaskExecutor) lookup( TaskExecutor.class.getName(), "perform-release"
);
         }
+
+        if ( releaseManager == null )
+        {
+            releaseManager = (ContinuumReleaseManager) lookup( ContinuumReleaseManager.ROLE
);
+        }
     }
 
     public void testReleaseSimpleProject()
         throws Exception
     {
-        String scmPath = new File( getBasedir(), "target/scm-src" ).getAbsolutePath().replace(
'\\', '/' );
+        String scmPath = new File( getBasedir(), "target/test-classes/scm-src" ).getAbsolutePath().replace(
'\\', '/' );
         File workDir = new File( getBasedir(), "target/test-classes/work-dir" );
         FileUtils.deleteDirectory( workDir );
         File testDir = new File( getBasedir(), "target/test-classes/test-dir" );
@@ -85,7 +95,7 @@
         String pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
         assertTrue( "Test dev version", pom.indexOf( "<version>1.0-SNAPSHOT</version>"
) > 0 );
 
-        prepareExec.executeTask( getPrepareTask( "testRelease", descriptor ) );
+        doPrepareWithNoError( descriptor );
 
         pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
         assertTrue( "Test version increment", pom.indexOf( "<version>1.1-SNAPSHOT</version>"
) > 0 );
@@ -101,7 +111,7 @@
     public void testReleaseSimpleProjectWithNextVersion()
         throws Exception
     {
-        String scmPath = new File( getBasedir(), "target/scm-src" ).getAbsolutePath().replace(
'\\', '/' );
+        String scmPath = new File( getBasedir(), "target/test-classes/scm-src" ).getAbsolutePath().replace(
'\\', '/' );
         File workDir = new File( getBasedir(), "target/test-classes/work-dir" );
         FileUtils.deleteDirectory( workDir );
         File testDir = new File( getBasedir(), "target/test-classes/test-dir" );
@@ -121,7 +131,7 @@
         String pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
         assertTrue( "Test dev version", pom.indexOf( "<version>1.1-SNAPSHOT</version>"
) > 0 );
 
-        prepareExec.executeTask( getPrepareTask( "testRelease", descriptor ) );
+        doPrepareWithNoError( descriptor );
 
         pom = FileUtils.fileRead( new File( workDir, "pom.xml" ) );
         assertTrue( "Test version increment", pom.indexOf( "<version>2.1-SNAPSHOT</version>"
) > 0 );
@@ -133,7 +143,26 @@
         pom = FileUtils.fileRead( new File( testDir, "pom.xml" ) );
         assertTrue( "Test released version", pom.indexOf( "<version>2.0</version>"
) > 0 );
 
-        performExec.executeTask( getPerformTask( "testRelease", descriptor, new File( getBasedir(),
"target/test-classes/build-dir" ) ) );
+        performExec.executeTask( getPerformTask( "testRelease", descriptor,
+                                                 new File( getBasedir(), "target/test-classes/build-dir"
) ) );
+
+        ReleaseResult result = (ReleaseResult) releaseManager.getReleaseResults().get( "testRelease"
);
+        if ( result.getResultCode() != ReleaseResult.SUCCESS )
+        {
+            fail( "Error in release:perform. Release output follows: " + result.getOutput()
);
+        }
+    }
+
+    private void doPrepareWithNoError( ReleaseDescriptor descriptor )
+        throws TaskExecutionException
+    {
+        prepareExec.executeTask( getPrepareTask( "testRelease", descriptor ) );
+
+        ReleaseResult result = (ReleaseResult) releaseManager.getReleaseResults().get( "testRelease"
);
+        if ( result.getResultCode() != ReleaseResult.SUCCESS )
+        {
+            fail( "Error in release:prepare. Release output follows:\n" + result.getOutput()
);
+        }
     }
 
     private Task getPrepareTask( String releaseId, ReleaseDescriptor descriptor )

Modified: maven/continuum/trunk/continuum-webapp/pom.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/pom.xml?view=diff&rev=448140&r1=448139&r2=448140
==============================================================================
--- maven/continuum/trunk/continuum-webapp/pom.xml (original)
+++ maven/continuum/trunk/continuum-webapp/pom.xml Wed Sep 20 02:53:20 2006
@@ -252,3 +252,4 @@
     </dependency>
   </dependencies>
 </project>
+

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PerformReleaseAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PerformReleaseAction.java?view=diff&rev=448140&r1=448139&r2=448140
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PerformReleaseAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PerformReleaseAction.java
Wed Sep 20 02:53:20 2006
@@ -132,13 +132,20 @@
 
         listener = (ContinuumReleaseManagerListener) releaseManager.getListeners().get( releaseId
);
 
-        if ( listener.getState() == ContinuumReleaseManagerListener.FINISHED )
+        if ( listener != null )
         {
-            status = "finished";
+            if ( listener.getState() == ContinuumReleaseManagerListener.FINISHED )
+            {
+                status = "finished";
+            }
+            else
+            {
+                status = "inProgress";
+            }
         }
         else
         {
-            status = "inProgress";
+            throw new Exception( "There is no release on-going or finished with id: " + releaseId
);
         }
 
         return status;

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PrepareReleaseAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PrepareReleaseAction.java?view=diff&rev=448140&r1=448139&r2=448140
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PrepareReleaseAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PrepareReleaseAction.java
Wed Sep 20 02:53:20 2006
@@ -84,15 +84,18 @@
         scmPassword = project.getScmPassword();
         scmTag = project.getScmTag();
         String scmUrl = project.getScmUrl();
+
+        //skip scm:provider in scm url
+        int idx = scmUrl.indexOf( ":", 4 ) + 1;
+        scmUrl = scmUrl.substring( idx );
+
         if ( scmUrl.endsWith( "/trunk" ) )
         {
-            //skip scm:provider in scm url
-            int idx = scmUrl.indexOf( ":", 4 ) + 1;
-            scmTagBase = scmUrl.substring( idx , scmUrl.lastIndexOf( "/trunk" ) ) + "/branches";
+            scmTagBase = scmUrl.substring( 0 , scmUrl.lastIndexOf( "/trunk" ) ) + "/branches";
         }
         else
         {
-            scmTagBase = scmUrl;
+            scmTagBase = scmUrl.substring( idx );
         }
         prepareGoals = "clean integration-test";
 
@@ -186,17 +189,24 @@
 
         listener = (ContinuumReleaseManagerListener) releaseManager.getListeners().get( releaseId
);
 
-        if ( listener.getState() == ContinuumReleaseManagerListener.FINISHED )
+        if ( listener != null )
         {
-            releaseManager.getListeners().remove( releaseId );
+            if ( listener.getState() == ContinuumReleaseManagerListener.FINISHED )
+            {
+                releaseManager.getListeners().remove( releaseId );
 
-            result = (ReleaseResult) releaseManager.getReleaseResults().get( releaseId );
+                result = (ReleaseResult) releaseManager.getReleaseResults().get( releaseId
);
 
-            status = "finished";
+                status = "finished";
+            }
+            else
+            {
+                status = "inProgress";
+            }
         }
         else
         {
-            status = "inProgress";
+            throw new Exception( "There is no release on-going or finished with id: " + releaseId
);
         }
 
         return status;

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/performRelease.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/performRelease.jsp?view=diff&rev=448140&r1=448139&r2=448140
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/performRelease.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/performRelease.jsp Wed Sep 20 02:53:20
2006
@@ -22,6 +22,7 @@
             <ww:textfield label="Maven Arguments" name="goals"/>
             <ww:checkbox label="Use Release Profile" name="useReleaseProfile" value="true"/>
           </table>
+        </div>
         <ww:submit/>
       </ww:form>
     </body>

Added: maven/continuum/trunk/continuum-webapp/src/main/webapp/releaseResult.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/releaseResult.jsp?view=auto&rev=448140
==============================================================================
    (empty)

Propchange: maven/continuum/trunk/continuum-webapp/src/main/webapp/releaseResult.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-webapp/src/main/webapp/releaseResult.jsp
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/viewReleaseResult.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/viewReleaseResult.jsp?view=diff&rev=448140&r1=448139&r2=448140
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/viewReleaseResult.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/viewReleaseResult.jsp Wed Sep 20
02:53:20 2006
@@ -37,7 +37,7 @@
         </ww:if>
         <ww:else>
           <div style="width:100%; height:500px; overflow:auto; border-style: solid; border-width:
1px">
-            <code><pre><ww:property value="result.output"/></pre></code>
+            <pre><ww:property value="result.output"/></pre>
           </div>
         </ww:else>
       </p>



Mime
View raw message