continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From epunza...@apache.org
Subject svn commit: r441470 - in /maven/continuum/branches/release-integration/continuum: continuum-api/src/main/java/org/apache/maven/continuum/release/ continuum-release/src/main/java/org/apache/maven/continuum/release/ continuum-release/src/main/java/org/ap...
Date Fri, 08 Sep 2006 10:53:53 GMT
Author: epunzalan
Date: Fri Sep  8 03:53:52 2006
New Revision: 441470

URL: http://svn.apache.org/viewvc?view=rev&rev=441470
Log:
PR: CONTINUUM-727

release:prepare part is almost complete... can't test it yet though bec the executors don't
seem to run even if the queue has tasks already.

release:perform part is half-way through

Added:
    maven/continuum/branches/release-integration/continuum/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManagerListener.java
  (with props)
    maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultReleaseManagerListener.java
  (with props)
    maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performRelease.jsp
  (with props)
    maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/prepareReleaseProgress.jsp
  (with props)
Modified:
    maven/continuum/branches/release-integration/continuum/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
    maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
    maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java
    maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PerformReleaseProjectTask.java
    maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PrepareReleaseProjectTask.java
    maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PerformReleaseAction.java
    maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PrepareReleaseAction.java
    maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java
    maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/resources/xwork.xml
    maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/prepareRelease.jsp
    maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/releaseProject.jsp

Modified: maven/continuum/branches/release-integration/continuum/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java?view=diff&rev=441470&r1=441469&r2=441470
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
Fri Sep  8 03:53:52 2006
@@ -39,7 +39,8 @@
      * @param releaseProperties
      * @throws ContinuumReleaseException
      */
-    void prepare( Project project, Properties releaseProperties, Map releaseVersions, Map
developmentVersions )
+    void prepare( Project project, Properties releaseProperties, Map releaseVersions,
+                    Map developmentVersions, ContinuumReleaseManagerListener listener )
         throws ContinuumReleaseException;
 
     /**

Added: maven/continuum/branches/release-integration/continuum/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManagerListener.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManagerListener.java?view=auto&rev=441470
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManagerListener.java
(added)
+++ maven/continuum/branches/release-integration/continuum/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManagerListener.java
Fri Sep  8 03:53:52 2006
@@ -0,0 +1,29 @@
+package org.apache.maven.continuum.release;
+
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.List;
+
+/**
+ * @author Edwin Punzalan
+ */
+public interface ContinuumReleaseManagerListener
+{
+    List getCompletedPhases();
+
+    String getInProgress();
+}

Propchange: maven/continuum/branches/release-integration/continuum/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManagerListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java?view=diff&rev=441470&r1=441469&r2=441470
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
Fri Sep  8 03:53:52 2006
@@ -28,9 +28,9 @@
 import java.io.File;
 import java.io.FileReader;
 import java.io.IOException;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
-import java.util.HashMap;
 
 /**
  * @author Jason van Zyl
@@ -49,12 +49,15 @@
      */
     private TaskQueue performReleaseQueue;
 
+    private Map listeners;
+
     /**
      * contains previous release:prepare descriptors; one per project
      */
     private Map preparedReleases;
 
-    public void prepare( Project project, Properties releaseProperties, Map relVersions,
Map devVersions )
+    public void prepare( Project project, Properties releaseProperties, Map relVersions,
+                           Map devVersions, ContinuumReleaseManagerListener listener )
         throws ContinuumReleaseException
     {
         String releaseId = project.getGroupId() + ":" + project.getArtifactId();
@@ -63,7 +66,9 @@
 
         try
         {
-            prepareReleaseQueue.put( new PrepareReleaseProjectTask( releaseId, descriptor
) );
+            prepareReleaseQueue.put( new PrepareReleaseProjectTask( releaseId, descriptor,
listener ) );
+
+            System.out.println( "Added to Prepare Queue" );
         }
         catch ( TaskQueueException e )
         {
@@ -108,8 +113,11 @@
     {
         try
         {
+            DefaultReleaseManagerListener listener = new DefaultReleaseManagerListener();
+            listeners.put( releaseId, listener );
+
             performReleaseQueue.put( new PerformReleaseProjectTask( releaseId, descriptor,
buildDirectory,
-                                                                    goals, useReleaseProfile
) );
+                                                                    goals, useReleaseProfile,
listener ) );
         }
         catch ( TaskQueueException e )
         {
@@ -138,8 +146,6 @@
         ReleaseDescriptor descriptor = new ReleaseDescriptor();
 
         //release properties from the project
-        descriptor.setScmUsername( project.getScmUsername() );
-        descriptor.setScmPassword( project.getScmPassword() );
         descriptor.setWorkingDirectory( project.getWorkingDirectory() );
         descriptor.setScmSourceUrl( project.getScmUrl() );
 
@@ -149,9 +155,29 @@
         descriptor.setReleaseVersions( relVersions );
         descriptor.setDevelopmentVersions( devVersions );
 
+        //other properties
+        if ( releaseProperties.containsKey( "username" ) )
+        {
+            descriptor.setScmUsername( releaseProperties.getProperty( "username" ) );
+        }
+        if ( releaseProperties.containsKey( "password" ) )
+        {
+            descriptor.setScmPassword( releaseProperties.getProperty( "password" ) );
+        }
+
         //forced properties
         descriptor.setInteractive( false );
 
         return descriptor;
+    }
+
+    public Map getListeners()
+    {
+        if ( listeners == null )
+        {
+            listeners = new HashMap();
+        }
+
+        return listeners;
     }
 }

Added: maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultReleaseManagerListener.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultReleaseManagerListener.java?view=auto&rev=441470
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultReleaseManagerListener.java
(added)
+++ maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultReleaseManagerListener.java
Fri Sep  8 03:53:52 2006
@@ -0,0 +1,87 @@
+package org.apache.maven.continuum.release;
+
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.plugins.release.ReleaseManagerListener;
+
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Collections;
+
+/**
+ * @author Edwin Punzalan
+ */
+public class DefaultReleaseManagerListener
+    implements ReleaseManagerListener, ContinuumReleaseManagerListener
+{
+    private List completed;
+
+    private String inProgress;
+
+    private List phases;
+
+    public void goalStart( String name, List phases )
+    {
+        this.phases = phases;
+        completed = Collections.synchronizedList( new ArrayList() );
+        inProgress = null;
+    }
+
+    public void phaseStart( String name )
+    {
+        inProgress = name;
+    }
+
+    public void phaseEnd()
+    {
+        completed.add( inProgress );
+        inProgress = null;
+    }
+
+    public void phaseSkip( String name )
+    {
+        completed.add( name );
+    }
+
+    public void goalEnd()
+    {
+    }
+
+    public void error( String message )
+    {
+    }
+
+    public List getCompletedPhases()
+    {
+        return completed;
+    }
+
+    public String getInProgress()
+    {
+        return inProgress;
+    }
+
+    public List getPhases()
+    {
+        return phases;
+    }
+
+    public void setPhases( List phases )
+    {
+        this.phases = phases;
+    }
+}

Propchange: maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultReleaseManagerListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java?view=diff&rev=441470&r1=441469&r2=441470
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java
Fri Sep  8 03:53:52 2006
@@ -17,6 +17,7 @@
  */
 
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
+import org.apache.maven.continuum.release.ContinuumReleaseManagerListener;
 import org.codehaus.plexus.taskqueue.Task;
 
 /**
@@ -29,7 +30,10 @@
 
     private ReleaseDescriptor descriptor;
 
-    public AbstractReleaseProjectTask( String releaseId, ReleaseDescriptor descriptor )
+    private ContinuumReleaseManagerListener listener;
+
+    public AbstractReleaseProjectTask( String releaseId, ReleaseDescriptor descriptor,
+                                       ContinuumReleaseManagerListener listener )
     {
         this.releaseId = releaseId;
         this.descriptor = descriptor;

Modified: maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PerformReleaseProjectTask.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PerformReleaseProjectTask.java?view=diff&rev=441470&r1=441469&r2=441470
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PerformReleaseProjectTask.java
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PerformReleaseProjectTask.java
Fri Sep  8 03:53:52 2006
@@ -17,6 +17,7 @@
  */
 
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
+import org.apache.maven.continuum.release.ContinuumReleaseManagerListener;
 
 import java.io.File;
 
@@ -33,9 +34,9 @@
     private boolean useReleaseProfile = true;
 
     public PerformReleaseProjectTask( String releaseId, ReleaseDescriptor descriptor, File
buildDirectory,
-                                      String goals, boolean useReleaseProfile )
+                                      String goals, boolean useReleaseProfile, ContinuumReleaseManagerListener
listener )
     {
-        super( releaseId, descriptor );
+        super( releaseId, descriptor, listener );
         setBuildDirectory( buildDirectory );
         setGoals( goals );
         setUseReleaseProfile( useReleaseProfile );

Modified: maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PrepareReleaseProjectTask.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PrepareReleaseProjectTask.java?view=diff&rev=441470&r1=441469&r2=441470
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PrepareReleaseProjectTask.java
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PrepareReleaseProjectTask.java
Fri Sep  8 03:53:52 2006
@@ -17,6 +17,7 @@
  */
 
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
+import org.apache.maven.continuum.release.ContinuumReleaseManagerListener;
 
 /**
  * @author Edwin Punzalan
@@ -24,8 +25,9 @@
 public class PrepareReleaseProjectTask
     extends AbstractReleaseProjectTask
 {
-    public PrepareReleaseProjectTask( String releaseId, ReleaseDescriptor descriptor )
+    public PrepareReleaseProjectTask( String releaseId, ReleaseDescriptor descriptor,
+                                      ContinuumReleaseManagerListener listener )
     {
-        super( releaseId, descriptor );
+        super( releaseId, descriptor, listener );
     }
 }

Modified: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PerformReleaseAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PerformReleaseAction.java?view=diff&rev=441470&r1=441469&r2=441470
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PerformReleaseAction.java
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PerformReleaseAction.java
Fri Sep  8 03:53:52 2006
@@ -32,11 +32,27 @@
 {
     private String releaseId;
 
+    private String scmUrl;
+
+    private String scmUsername;
+
+    private String scmPassword;
+
+    private String scmTag;
+
+    private String scmTagBase;
+
     private String goals;
 
     private boolean useReleaseProfile;
 
     public String execute()
+        throws Exception
+    {
+        return "prompt";
+    }
+
+    public String doPerform()
         throws Exception
     {
         ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();

Modified: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PrepareReleaseAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PrepareReleaseAction.java?view=diff&rev=441470&r1=441469&r2=441470
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PrepareReleaseAction.java
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/PrepareReleaseAction.java
Fri Sep  8 03:53:52 2006
@@ -18,11 +18,21 @@
 
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.release.ContinuumReleaseManager;
+import org.apache.maven.continuum.release.DefaultReleaseManagerListener;
+import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
+import org.apache.maven.model.Model;
+import org.apache.maven.plugins.release.versions.VersionInfo;
+import org.apache.maven.plugins.release.versions.DefaultVersionInfo;
+import org.codehaus.plexus.util.StringUtils;
 
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
+import java.util.Iterator;
+import java.util.ArrayList;
+import java.io.FileReader;
+import java.io.File;
 
 /**
  * @author Edwin Punzalan
@@ -36,6 +46,8 @@
 {
     private int projectId;
 
+    private String name;
+
     private String scmUsername;
 
     private String scmPassword;
@@ -44,24 +56,91 @@
 
     private String scmTagBase;
 
+    private List projects = new ArrayList();
+
     private List projectKeys;
 
     private List devVersions;
 
     private List relVersions;
 
+    private DefaultReleaseManagerListener listener;
+
     public String execute()
         throws Exception
     {
         Project project = getContinuum().getProject( projectId );
+        scmUsername = project.getScmUsername();
+        scmPassword = project.getScmPassword();
+        scmTag = project.getScmTag();
+        scmTagBase = "";
+
+        processProject( project.getWorkingDirectory(), "pom.xml" );
+
+        return "prepareRelease";
+    }
+
+    public String doPrepare()
+        throws Exception
+    {
+        listener = new DefaultReleaseManagerListener();
+
+        Project project = getContinuum().getProject( projectId );
+
+        name = project.getName();
 
         ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
 
-        releaseManager.prepare( project, getReleaseProperties(), getRelVersionMap(), getDevVersionMap()
);
+        releaseManager.prepare( project, getReleaseProperties(), getRelVersionMap(), getDevVersionMap(),
listener );
 
         return SUCCESS;
     }
 
+    private void processProject( String workingDirectory, String pomFilename )
+        throws Exception
+    {
+        MavenXpp3Reader pomReader = new MavenXpp3Reader();
+        Model model = pomReader.read( new FileReader( new File( workingDirectory, pomFilename
) ) );
+
+        if ( model.getGroupId() == null )
+        {
+            model.setGroupId( model.getParent().getGroupId() );
+        }
+
+        if ( model.getVersion() == null )
+        {
+            model.setVersion( model.getParent().getVersion() );
+        }
+
+        setProperties( model );
+
+        for( Iterator modules = model.getModules().iterator(); modules.hasNext(); )
+        {
+            processProject( workingDirectory + "/" + modules.next().toString(), "pom.xml"
);
+        }
+    }
+
+    private void setProperties( Model model )
+        throws Exception
+    {
+        Map params = new HashMap();
+
+        params.put( "key", model.getGroupId() + ":" + model.getArtifactId() );
+
+        if ( model.getName() == null )
+        {
+            model.setName( model.getArtifactId() );
+        }
+        params.put( "name", model.getName() );
+
+        VersionInfo version = new DefaultVersionInfo( model.getVersion() );
+
+        params.put( "release", version.getReleaseVersionString() );
+        params.put( "dev", version.getNextVersion().getSnapshotVersionString() );
+
+        projects.add( params );
+    }
+
     private Map getDevVersionMap()
     {
         return getVersionMap( projectKeys, devVersions );
@@ -91,6 +170,16 @@
     {
         Properties p = new Properties();
 
+        if ( StringUtils.isNotEmpty( scmUsername ) )
+        {
+            p.setProperty( "username", scmUsername );
+        }
+
+        if ( StringUtils.isNotEmpty( scmPassword ) )
+        {
+            p.setProperty( "password", scmPassword );
+        }
+
         p.setProperty( "tag", scmTag );
         p.setProperty( "tagBase", scmTagBase );
 
@@ -175,5 +264,35 @@
     public void setScmTagBase( String scmTagBase )
     {
         this.scmTagBase = scmTagBase;
+    }
+
+    public List getProjects()
+    {
+        return projects;
+    }
+
+    public void setProjects( List projects )
+    {
+        this.projects = projects;
+    }
+
+    public DefaultReleaseManagerListener getListener()
+    {
+        return listener;
+    }
+
+    public void setListener( DefaultReleaseManagerListener listener )
+    {
+        this.listener = listener;
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+
+    public void setName( String name )
+    {
+        this.name = name;
     }
 }

Modified: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java?view=diff&rev=441470&r1=441469&r2=441470
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleaseProjectAction.java
Fri Sep  8 03:53:52 2006
@@ -19,18 +19,9 @@
 import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.release.ContinuumReleaseManager;
-import org.apache.maven.model.Model;
-import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.plugins.release.config.ReleaseDescriptor;
-import org.apache.maven.plugins.release.versions.DefaultVersionInfo;
-import org.apache.maven.plugins.release.versions.VersionInfo;
+import org.codehaus.plexus.util.StringUtils;
 
-import java.io.File;
-import java.io.FileReader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
 import java.util.Map;
 
 /**
@@ -49,17 +40,9 @@
 
     private String goal;
 
-    private Project project;
-
-    private String scmUsername;
-
-    private String scmPassword;
-
-    private String scmTag;
-
-    private String scmTagBase;
+    private String scmUrl;
 
-    private List projects = new ArrayList();
+    private Project project;
 
     public String promptReleaseGoal()
         throws Exception
@@ -75,7 +58,7 @@
         {
             ReleaseDescriptor descriptor = (ReleaseDescriptor) preparedReleases.get( releaseId
);
 
-            preparedReleaseName = descriptor.getName();
+            preparedReleaseName = descriptor.getReleaseVersions().get( releaseId ).toString();
         }
 
         return "prompt";
@@ -86,81 +69,23 @@
     {
         if ( "prepare".equals( goal ) )
         {
-            return doPrepare();
+            return "prepareRelease";
         }
         else if ( "perform".equals( goal ) )
         {
-            return doPerform();
-        }
-        else
-        {
-            return "prompt";
-        }
-    }
-
-    public String doPrepare()
-        throws Exception
-    {
-        project = getContinuum().getProject( projectId );
-        scmUsername = project.getScmUsername();
-        scmPassword = project.getScmPassword();
-        scmTag = project.getScmTag();
-        scmTagBase = "";
-
-        processProject( project.getWorkingDirectory(), "pom.xml" );
-
-        return "prepareRelease";
-    }
-
-    public String doPerform()
-        throws Exception
-    {
-        return "performRelease";
-    }
-
-    private void processProject( String workingDirectory, String pomFilename )
-        throws Exception
-    {
-        MavenXpp3Reader pomReader = new MavenXpp3Reader();
-        Model model = pomReader.read( new FileReader( new File( workingDirectory, pomFilename
) ) );
-
-        if ( model.getGroupId() == null )
-        {
-            model.setGroupId( model.getParent().getGroupId() );
-        }
-
-        if ( model.getVersion() == null )
-        {
-            model.setVersion( model.getParent().getVersion() );
-        }
+            if ( StringUtils.isNotEmpty( preparedReleaseName ) )
+            {
+                project = getContinuum().getProjectWithAllDetails( projectId );
 
-        setProperties( model );
+                scmUrl = project.getScmUrl();
+            }
 
-        for( Iterator modules = model.getModules().iterator(); modules.hasNext(); )
-        {
-            processProject( workingDirectory + "/" + modules.next().toString(), "pom.xml"
);
+            return "performRelease";
         }
-    }
-
-    private void setProperties( Model model )
-        throws Exception
-    {
-        Map params = new HashMap();
-
-        params.put( "key", model.getGroupId() + ":" + model.getArtifactId() );
-
-        if ( model.getName() == null )
+        else
         {
-            model.setName( model.getArtifactId() );
+            return "prompt";
         }
-        params.put( "name", model.getName() );
-
-        VersionInfo version = new DefaultVersionInfo( project.getVersion() );
-
-        params.put( "release", version.getReleaseVersionString() );
-        params.put( "dev", version.getNextVersion().getSnapshotVersionString() );
-
-        projects.add( params );
     }
 
     public int getProjectId()
@@ -203,53 +128,13 @@
         this.project = project;
     }
 
-    public List getProjects()
-    {
-        return projects;
-    }
-
-    public void setProjects( List projects )
-    {
-        this.projects = projects;
-    }
-
-    public String getScmUsername()
-    {
-        return scmUsername;
-    }
-
-    public void setScmUsername( String scmUsername )
-    {
-        this.scmUsername = scmUsername;
-    }
-
-    public String getScmPassword()
-    {
-        return scmPassword;
-    }
-
-    public void setScmPassword( String scmPassword )
-    {
-        this.scmPassword = scmPassword;
-    }
-
-    public String getScmTag()
-    {
-        return scmTag;
-    }
-
-    public void setScmTag( String scmTag )
-    {
-        this.scmTag = scmTag;
-    }
-
-    public String getScmTagBase()
+    public String getScmUrl()
     {
-        return scmTagBase;
+        return scmUrl;
     }
 
-    public void setScmTagBase( String scmTagBase )
+    public void setScmUrl( String scmUrl )
     {
-        this.scmTagBase = scmTagBase;
+        this.scmUrl = scmUrl;
     }
 }

Modified: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/resources/xwork.xml
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/resources/xwork.xml?view=diff&rev=441470&r1=441469&r2=441470
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/resources/xwork.xml
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/resources/xwork.xml
Fri Sep  8 03:53:52 2006
@@ -299,16 +299,33 @@
     -->
     <action name="releaseProject" class="releaseProject">
       <result name="prompt">releaseProject.jsp</result>
-      <result name="prepareRelease">prepareRelease.jsp</result>
-      <result name="performRelease">performRelease.jsp</result>
+      <result name="prepareRelease" type="redirect-action">
+        <param name="actionName">prepareRelease</param>
+        <param name="projectId">${projectId}</param>
+      </result>
+      <result name="performRelease">
+        <param name="actionName">performRelease</param>
+        <param name="projectId">${projectId}</param>
+      </result>
     </action>
 
     <action name="prepareRelease" class="prepareRelease">
-      <result name="success">prepareReleaseProgress.jsp</result>
+      <interceptor-ref name="execAndWait">
+        <param name="delay">5000</param>
+      </interceptor-ref>
+      <result name="wait">prepareReleaseProgress.jsp</result>
+      <result name="error">prepareReleaseFailure.jsp</result>
+      <result name="success">prepareReleaseFinished.jsp</result>
     </action>
 
     <action name="performRelease" class="performRelease">
-      <result name="success">performReleaseProgress.jsp</result>
+      <interceptor-ref name="execAndWait">
+        <param name="delay">5000</param>
+        <param name="scmUrl">${scmUrl}</param>
+      </interceptor-ref>
+      <result name="wait">performReleaseProgress.jsp</result>
+      <result name="error">performReleaseFailure.jsp</result>
+      <result name="success">performReleaseFinished.jsp</result>
     </action>
 
   </package>

Added: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performRelease.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performRelease.jsp?view=auto&rev=441470
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performRelease.jsp
(added)
+++ maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performRelease.jsp
Fri Sep  8 03:53:52 2006
@@ -0,0 +1,29 @@
+<%@ taglib uri="/webwork" prefix="ww" %>
+<%@ taglib uri="/tld/extremecomponents" prefix="ec" %>
+<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
+<%@ taglib uri="continuum" prefix="c1" %>
+<html>
+  <ww:i18n name="localization.Continuum">
+    <head>
+        <title><ww:text name="releaseProject.page.title"/></title>
+    </head>
+    <body>
+      <h2>Prepare Project Release</h2>
+      <ww:form action="performRelease!doPerform.action" method="post">
+        <h3>Common Release Parameters</h3>
+        <input type="hidden" name="projectId" value="<ww:property value="projectId"/>"/>
+        <div class="axial">
+          <table border="1" cellspacing="2" cellpadding="3" width="100%">
+            <ww:textfield label="SCM Connection URL" name="scmUrl"/>
+            <ww:textfield label="SCM Username" name="scmUsername"/>
+            <ww:textfield label="SCM Password" name="scmPassword"/>
+            <ww:textfield label="SCM Tag" name="scmTag"/>
+            <ww:textfield label="SCM Tag Base" name="scmTagBase"/>
+            <ww:textfield label="Maven Arguments" name="goals"/>
+            <ww:checkbox label="Use Release Profile" name="useReleaseProfile" value="true"/>
+          </table>
+        <ww:submit/>
+      </ww:form>
+    </body>
+  </ww:i18n>
+</html>

Propchange: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/performRelease.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/prepareRelease.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/prepareRelease.jsp?view=diff&rev=441470&r1=441469&r2=441470
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/prepareRelease.jsp
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/prepareRelease.jsp
Fri Sep  8 03:53:52 2006
@@ -8,36 +8,16 @@
         <title><ww:text name="releaseProject.page.title"/></title>
     </head>
     <body>
-      <h2>Prepare Project Release</h2>
-      <ww:form action="prepareRelease" method="post">
-        <h3>Common Release Parameters</h3>
+      <h2>Perform Project Release</h2>
+      <ww:form action="performRelease!doPerform.action" method="post">
+        <h3>Release Parameters</h3>
         <input type="hidden" name="projectId" value="<ww:property value="projectId"/>"/>
         <div class="axial">
           <table border="1" cellspacing="2" cellpadding="3" width="100%">
-            <tr>
-              <th>SCM Username</th>
-              <td>
-                <input type="text" name="scmUsername" value="<ww:property value="scmUsername"/>"
size="100">
-              </td>
-            </tr>
-            <tr>
-              <th>SCM Password</th>
-              <td>
-                <input type="text" name="scmPassword" value="<ww:property value="scmPassword"/>"
size="100">
-              </td>
-            </tr>
-            <tr>
-              <th>SCM Tag</th>
-              <td>
-                <input type="text" name="scmTag" value="<ww:property value="scmTag"/>"
size="100">
-              </td>
-            </tr>
-            <tr>
-              <th>SCM Tag Base</th>
-              <td>
-                <input type="text" name="scmTagBase" value="<ww:property value="scmTagBase"/>"
size="100">
-              </td>
-            </tr>
+            <ww:textfield label="SCM Url" name="scmUsername"/>
+            <ww:textfield label="SCM Password" name="scmPassword"/>
+            <ww:textfield label="SCM Tag" name="scmTag"/>
+            <ww:textfield label="SCM Tag Base" name="scmTagBase"/>
            </table>
         </div>
 

Added: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/prepareReleaseProgress.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/prepareReleaseProgress.jsp?view=auto&rev=441470
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/prepareReleaseProgress.jsp
(added)
+++ maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/prepareReleaseProgress.jsp
Fri Sep  8 03:53:52 2006
@@ -0,0 +1,34 @@
+<%@ taglib uri="/webwork" prefix="ww" %>
+<%@ taglib uri="/tld/extremecomponents" prefix="ec" %>
+<%@ taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
+<%@ taglib uri="continuum" prefix="c1" %>
+<html>
+  <ww:i18n name="localization.Continuum">
+    <head>
+        <title><ww:text name="releaseProject.page.title"/></title>
+    </head>
+    <body>
+      <h2>Continuum Release</h2>
+      <h3><ww:property value="name"/></h3>
+      <div class="axial">
+        <table border="1" cellspacing="2" cellpadding="3" width="100%">
+          <tr>
+            <th>&nbsp;</th>
+            <th>Phase</th>
+          </tr>
+          <ww:iterator value="listener.phases">
+            <tr>
+              <ww:if test="listener.completedPhases.contains( listener.phases )">
+                <td>done</td>
+              </ww:if>
+              <ww:else>
+                <td>not done</td>
+              </ww:else>
+              <td><ww:property/></td>
+            </tr>
+          </ww:iterator>
+        </table>
+      </div>
+    </body>
+  </ww:i18n>
+</html>

Propchange: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/prepareReleaseProgress.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/releaseProject.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/releaseProject.jsp?view=diff&rev=441470&r1=441469&r2=441470
==============================================================================
--- maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/releaseProject.jsp
(original)
+++ maven/continuum/branches/release-integration/continuum/continuum-webapp/src/main/webapp/releaseProject.jsp
Fri Sep  8 03:53:52 2006
@@ -16,13 +16,13 @@
           <input name="goal" type="radio" value="perform"/>Perform project release
           <br/>
           &nbsp;&nbsp;&nbsp;
-          <select name="performScript">
+          <select name="preparedReleaseName">
             <ww:if test="preparedReleaseName != null">
               <option selected value="<ww:property value="preparedReleaseName"/>">
                 <ww:property value="preparedReleaseName"/>
               </option>
             </ww:if>
-            <option value="">Provide release descriptor</option>
+            <option value="none">Provide release descriptor</option>
           </select>
           <br/>
         </p>



Mime
View raw message