continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r698412 - in /continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/release/ continuum-commons/ continuum-commons/src/main/java/org/apache/continuum/ continuum-commons/src/main/java/org/apache/continuum/utils/ continuum-co...
Date Wed, 24 Sep 2008 01:55:20 GMT
Author: ctan
Date: Tue Sep 23 18:55:19 2008
New Revision: 698412

URL: http://svn.apache.org/viewvc?rev=698412&view=rev
Log:
merge branch CONTINUUM-1572

Added:
    continuum/trunk/continuum-commons/src/main/java/org/apache/continuum/
      - copied from r698102, continuum/branches/CONTINUUM-1572/continuum-commons/src/main/java/org/apache/continuum/
    continuum/trunk/continuum-commons/src/main/java/org/apache/continuum/utils/
      - copied from r698102, continuum/branches/CONTINUUM-1572/continuum-commons/src/main/java/org/apache/continuum/utils/
    continuum/trunk/continuum-commons/src/main/java/org/apache/continuum/utils/shell/
      - copied from r698102, continuum/branches/CONTINUUM-1572/continuum-commons/src/main/java/org/apache/continuum/utils/shell/
    continuum/trunk/continuum-commons/src/main/java/org/apache/continuum/utils/shell/DefaultShellCommandHelper.java
      - copied unchanged from r698102, continuum/branches/CONTINUUM-1572/continuum-commons/src/main/java/org/apache/continuum/utils/shell/DefaultShellCommandHelper.java
    continuum/trunk/continuum-commons/src/main/java/org/apache/continuum/utils/shell/ExecutionResult.java
      - copied unchanged from r698102, continuum/branches/CONTINUUM-1572/continuum-commons/src/main/java/org/apache/continuum/utils/shell/ExecutionResult.java
    continuum/trunk/continuum-commons/src/main/java/org/apache/continuum/utils/shell/ShellCommandHelper.java
      - copied unchanged from r698102, continuum/branches/CONTINUUM-1572/continuum-commons/src/main/java/org/apache/continuum/utils/shell/ShellCommandHelper.java
    continuum/trunk/continuum-release/src/main/java/org/apache/continuum/
      - copied from r698102, continuum/branches/CONTINUUM-1572/continuum-release/src/main/java/org/apache/continuum/
    continuum/trunk/continuum-release/src/main/java/org/apache/continuum/release/
      - copied from r698102, continuum/branches/CONTINUUM-1572/continuum-release/src/main/java/org/apache/continuum/release/
    continuum/trunk/continuum-release/src/main/java/org/apache/continuum/release/config/
      - copied from r698102, continuum/branches/CONTINUUM-1572/continuum-release/src/main/java/org/apache/continuum/release/config/
    continuum/trunk/continuum-release/src/main/java/org/apache/continuum/release/config/ContinuumPropertiesReleaseDescriptorStore.java
      - copied unchanged from r698102, continuum/branches/CONTINUUM-1572/continuum-release/src/main/java/org/apache/continuum/release/config/ContinuumPropertiesReleaseDescriptorStore.java
    continuum/trunk/continuum-release/src/main/java/org/apache/continuum/release/config/ContinuumReleaseDescriptor.java
      - copied unchanged from r698102, continuum/branches/CONTINUUM-1572/continuum-release/src/main/java/org/apache/continuum/release/config/ContinuumReleaseDescriptor.java
    continuum/trunk/continuum-release/src/main/java/org/apache/continuum/release/phase/
      - copied from r698102, continuum/branches/CONTINUUM-1572/continuum-release/src/main/java/org/apache/continuum/release/phase/
    continuum/trunk/continuum-release/src/main/java/org/apache/continuum/release/phase/AbstractContinuumRunGoalsPhase.java
      - copied unchanged from r698102, continuum/branches/CONTINUUM-1572/continuum-release/src/main/java/org/apache/continuum/release/phase/AbstractContinuumRunGoalsPhase.java
    continuum/trunk/continuum-release/src/main/java/org/apache/continuum/release/phase/RunPerformGoalsPhase.java
      - copied unchanged from r698102, continuum/branches/CONTINUUM-1572/continuum-release/src/main/java/org/apache/continuum/release/phase/RunPerformGoalsPhase.java
    continuum/trunk/continuum-release/src/main/java/org/apache/continuum/release/phase/RunPrepareGoalsPhase.java
      - copied unchanged from r698102, continuum/branches/CONTINUUM-1572/continuum-release/src/main/java/org/apache/continuum/release/phase/RunPrepareGoalsPhase.java
Removed:
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/
Modified:
    continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
    continuum/trunk/continuum-commons/pom.xml
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/profile/DefaultProfileService.java
    continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorTest.java
    continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
    continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java
    continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PerformReleaseProjectTask.java
    continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PrepareReleaseProjectTask.java
    continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/RollbackReleaseProjectTask.java
    continuum/trunk/continuum-release/src/main/resources/META-INF/plexus/components.xml
    continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
    continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ProfileAction.java
    continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
    continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/profilesList.jsp
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePerformFromScm.jsp
    continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePrepare.jsp

Modified: continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java?rev=698412&r1=698411&r2=698412&view=diff
==============================================================================
--- continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
(original)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/release/ContinuumReleaseManager.java
Tue Sep 23 18:55:19 2008
@@ -21,6 +21,7 @@
 
 import org.apache.continuum.model.repository.LocalRepository;
 import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.system.Profile;
 
 import java.io.File;
 import java.util.Map;
@@ -50,6 +51,22 @@
     String prepare( Project project, Properties releaseProperties, Map releaseVersions, Map
developmentVersions,
                     ContinuumReleaseManagerListener listener )
         throws ContinuumReleaseException;
+    
+    /**
+     * Prepare a project for release
+     *
+     * @param project
+     * @param releaseProperties
+     * @param releaseVersions
+     * @param developmentVersions
+     * @param listener
+     * @param profile
+     * @return
+     * @throws ContinuumReleaseException
+     */
+    String prepare( Project project, Properties releaseProperties, Map releaseVersions, Map
developmentVersions,
+                    ContinuumReleaseManagerListener listener, Profile profile )
+        throws ContinuumReleaseException;
 
     /**
      * Perform a release based on a given releaseId
@@ -99,4 +116,6 @@
     void perform( String releaseId, File buildDirectory, String goals, boolean useReleaseProfile,
                   ContinuumReleaseManagerListener listener, LocalRepository repository )
         throws ContinuumReleaseException;
+    
+    Map<String, String> getEnvironments( Profile profile );
 }

Modified: continuum/trunk/continuum-commons/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-commons/pom.xml?rev=698412&r1=698411&r2=698412&view=diff
==============================================================================
--- continuum/trunk/continuum-commons/pom.xml (original)
+++ continuum/trunk/continuum-commons/pom.xml Tue Sep 23 18:55:19 2008
@@ -43,6 +43,17 @@
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-spring</artifactId>
     </dependency>    
+    <dependency>
+      <groupId>org.apache.maven.release</groupId>
+      <artifactId>maven-release-manager</artifactId>
+      <version>1.0-alpha-3</version>
+      <exclusions>
+        <exclusion>
+          <groupId>org.codehaus.plexus</groupId>
+          <artifactId>plexus-container-default</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
     <!-- === Testing Dependencies === -->
     <dependency>
       <groupId>hsqldb</groupId>

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java?rev=698412&r1=698411&r2=698412&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
Tue Sep 23 18:55:19 2008
@@ -19,6 +19,8 @@
  * under the License.
  */
 
+import org.apache.continuum.utils.shell.ExecutionResult;
+import org.apache.continuum.utils.shell.ShellCommandHelper;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.continuum.installation.InstallationService;
 import org.apache.maven.continuum.model.project.BuildDefinition;
@@ -28,8 +30,6 @@
 import org.apache.maven.continuum.model.system.Profile;
 import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.apache.maven.continuum.utils.WorkingDirectoryService;
-import org.apache.maven.continuum.utils.shell.ExecutionResult;
-import org.apache.maven.continuum.utils.shell.ShellCommandHelper;
 import org.codehaus.plexus.commandline.ExecutableResolver;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/profile/DefaultProfileService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/profile/DefaultProfileService.java?rev=698412&r1=698411&r2=698412&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/profile/DefaultProfileService.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/profile/DefaultProfileService.java
Tue Sep 23 18:55:19 2008
@@ -131,7 +131,14 @@
     public void deleteProfile( int profileId )
         throws ProfileException
     {
-        profileDao.removeProfile( getProfile( profileId ) );
+        try
+        {
+            profileDao.removeProfile( getProfile( profileId ) );
+        }
+        catch ( Exception e )
+        {
+            throw new ProfileException( "Cannot remove the profile", e );
+        }
     }
 
     /**

Modified: continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorTest.java?rev=698412&r1=698411&r2=698412&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorTest.java
(original)
+++ continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorTest.java
Tue Sep 23 18:55:19 2008
@@ -25,14 +25,14 @@
 
 import junit.framework.TestCase;
 
+import org.apache.continuum.utils.shell.ExecutionResult;
+import org.apache.continuum.utils.shell.ShellCommandHelper;
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.configuration.DefaultConfigurationService;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectGroup;
 import org.apache.maven.continuum.utils.ChrootJailWorkingDirectoryService;
-import org.apache.maven.continuum.utils.shell.ExecutionResult;
-import org.apache.maven.continuum.utils.shell.ShellCommandHelper;
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.logging.console.ConsoleLogger;
 import org.jmock.Expectations;

Modified: continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java?rev=698412&r1=698411&r2=698412&view=diff
==============================================================================
--- continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
(original)
+++ continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/DefaultContinuumReleaseManager.java
Tue Sep 23 18:55:19 2008
@@ -20,7 +20,11 @@
  */
 
 import org.apache.continuum.model.repository.LocalRepository;
+import org.apache.continuum.release.config.ContinuumReleaseDescriptor;
+import org.apache.maven.continuum.installation.InstallationService;
 import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.system.Installation;
+import org.apache.maven.continuum.model.system.Profile;
 import org.apache.maven.continuum.release.tasks.PerformReleaseProjectTask;
 import org.apache.maven.continuum.release.tasks.PrepareReleaseProjectTask;
 import org.apache.maven.continuum.release.tasks.RollbackReleaseProjectTask;
@@ -32,9 +36,13 @@
 import org.codehaus.plexus.taskqueue.Task;
 import org.codehaus.plexus.taskqueue.TaskQueue;
 import org.codehaus.plexus.taskqueue.TaskQueueException;
+import org.codehaus.plexus.util.StringUtils;
 
 import java.io.File;
+import java.util.Collections;
+import java.util.HashMap;
 import java.util.Hashtable;
+import java.util.List;
 import java.util.Map;
 import java.util.Properties;
 
@@ -69,6 +77,11 @@
      * @plexus.requirement
      */
     private WorkingDirectoryService workingDirectoryService;
+
+    /**
+     * @plexus.requirement
+     */
+    private InstallationService installationService;
     
     private Map listeners;
 
@@ -90,16 +103,23 @@
                            ContinuumReleaseManagerListener listener )
         throws ContinuumReleaseException
     {
+        return prepare( project, releaseProperties, relVersions, devVersions, listener, null
);
+    }
+
+    public String prepare( Project project, Properties releaseProperties, Map relVersions,
Map devVersions,
+                           ContinuumReleaseManagerListener listener, Profile profile )
+        throws ContinuumReleaseException
+    {
         String releaseId = project.getGroupId() + ":" + project.getArtifactId();
 
-        ReleaseDescriptor descriptor = getReleaseDescriptor( project, releaseProperties,
relVersions, devVersions );
+        ReleaseDescriptor descriptor = getReleaseDescriptor( project, releaseProperties,
relVersions, devVersions, profile );
 
         getListeners().put( releaseId, listener );
 
         try
         {
             prepareReleaseQueue.put(
-                new PrepareReleaseProjectTask( releaseId, descriptor, (ReleaseManagerListener)
listener ) );
+                new PrepareReleaseProjectTask( releaseId, descriptor, (ReleaseManagerListener)
listener, profile ) );
 
         }
         catch ( TaskQueueException e )
@@ -199,10 +219,43 @@
         return releaseResults;
     }
 
+    public Map<String, String> getEnvironments( Profile profile )
+    {
+        if ( profile == null )
+        {
+            return Collections.EMPTY_MAP;
+        }
+
+        Map<String, String> envVars = new HashMap<String, String>();
+        if ( profile == null )
+        {
+            return envVars;
+        }
+
+        String javaHome = getJavaHomeValue( profile );
+        if ( !StringUtils.isEmpty( javaHome ) )
+        {
+            envVars.put( installationService.getEnvVar( InstallationService.JDK_TYPE ), javaHome
);
+        }
+
+        Installation builder = profile.getBuilder();
+        if ( builder != null )
+        {
+            envVars.put( installationService.getEnvVar( InstallationService.MAVEN2_TYPE ),
builder.getVarValue() );
+        }
+
+        List<Installation> installations = profile.getEnvironmentVariables();
+        for ( Installation installation : installations )
+        {
+            envVars.put( installation.getVarName(), installation.getVarValue() );
+        }
+        return envVars;
+    }
+
     private ReleaseDescriptor getReleaseDescriptor( Project project, Properties releaseProperties,
Map relVersions,
-                                                    Map devVersions )
+                                                    Map devVersions, Profile profile )
     {
-        ReleaseDescriptor descriptor = new ReleaseDescriptor();
+        ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
         String workingDirectory = workingDirectoryService.getWorkingDirectory( project ).getPath();

 
         //release properties from the project
@@ -235,7 +288,10 @@
 
         //forced properties
         descriptor.setInteractive( false );
-
+        
+        //set environments
+        descriptor.setEnvironments( getEnvironments( profile ) );
+        
         return descriptor;
     }
 
@@ -266,4 +322,14 @@
 
         return listeners;
     }
+
+    private String getJavaHomeValue( Profile profile )
+    {
+        Installation jdk = profile.getJdk();
+        if ( jdk == null )
+        {
+            return null;
+        }
+        return jdk.getVarValue();
+    }
 }

Modified: continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java?rev=698412&r1=698411&r2=698412&view=diff
==============================================================================
--- continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java
(original)
+++ continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/AbstractReleaseProjectTask.java
Tue Sep 23 18:55:19 2008
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.maven.continuum.model.system.Profile;
 import org.apache.maven.shared.release.ReleaseManagerListener;
 import org.apache.maven.shared.release.config.ReleaseDescriptor;
 import org.codehaus.plexus.taskqueue.Task;
@@ -37,11 +38,15 @@
 
     private long maxExecutionTime;
 
-    public AbstractReleaseProjectTask( String releaseId, ReleaseDescriptor descriptor, ReleaseManagerListener
listener )
+    private Profile profile;
+
+    public AbstractReleaseProjectTask( String releaseId, ReleaseDescriptor descriptor, ReleaseManagerListener
listener,
+                                       Profile profile )
     {
         this.releaseId = releaseId;
         this.descriptor = descriptor;
         this.listener = listener;
+        this.profile = profile;
     }
 
     public ReleaseDescriptor getDescriptor()
@@ -83,4 +88,14 @@
     {
         this.maxExecutionTime = maxTime;
     }
+
+    public Profile getProfile()
+    {
+        return profile;
+    }
+
+    public void setProfile( Profile profile )
+    {
+        this.profile = profile;
+    }
 }

Modified: continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PerformReleaseProjectTask.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PerformReleaseProjectTask.java?rev=698412&r1=698411&r2=698412&view=diff
==============================================================================
--- continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PerformReleaseProjectTask.java
(original)
+++ continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PerformReleaseProjectTask.java
Tue Sep 23 18:55:19 2008
@@ -20,6 +20,7 @@
  */
 
 import org.apache.continuum.model.repository.LocalRepository;
+import org.apache.maven.continuum.model.system.Profile;
 import org.apache.maven.shared.release.ReleaseManagerListener;
 import org.apache.maven.shared.release.config.ReleaseDescriptor;
 
@@ -42,13 +43,20 @@
     public PerformReleaseProjectTask( String releaseId, ReleaseDescriptor descriptor, File
buildDirectory, String goals,
                                       boolean useReleaseProfile, ReleaseManagerListener listener
)
     {
-        this( releaseId, descriptor, buildDirectory, goals, useReleaseProfile, listener,
null );
+        this( releaseId, descriptor, buildDirectory, goals, useReleaseProfile, listener,
null, null );
     }
 
     public PerformReleaseProjectTask( String releaseId, ReleaseDescriptor descriptor, File
buildDirectory, String goals,
                                       boolean useReleaseProfile, ReleaseManagerListener listener,
LocalRepository repository )
     {
-        super( releaseId, descriptor, listener );
+        this( releaseId, descriptor, buildDirectory, goals, useReleaseProfile, listener,
repository, null );
+    }
+    
+    public PerformReleaseProjectTask( String releaseId, ReleaseDescriptor descriptor, File
buildDirectory, String goals,
+                                      boolean useReleaseProfile, ReleaseManagerListener listener,
LocalRepository repository,
+                                      Profile profile )
+    {
+        super( releaseId, descriptor, listener, profile );
         setBuildDirectory( buildDirectory );
         setGoals( goals );
         setUseReleaseProfile( useReleaseProfile );

Modified: continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PrepareReleaseProjectTask.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PrepareReleaseProjectTask.java?rev=698412&r1=698411&r2=698412&view=diff
==============================================================================
--- continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PrepareReleaseProjectTask.java
(original)
+++ continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/PrepareReleaseProjectTask.java
Tue Sep 23 18:55:19 2008
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.maven.continuum.model.system.Profile;
 import org.apache.maven.shared.release.ReleaseManagerListener;
 import org.apache.maven.shared.release.config.ReleaseDescriptor;
 
@@ -30,6 +31,11 @@
 {
     public PrepareReleaseProjectTask( String releaseId, ReleaseDescriptor descriptor, ReleaseManagerListener
listener )
     {
-        super( releaseId, descriptor, listener );
+        this( releaseId, descriptor, listener, null );
+    }
+    
+    public PrepareReleaseProjectTask( String releaseId, ReleaseDescriptor descriptor, ReleaseManagerListener
listener, Profile profile )
+    {
+        super( releaseId, descriptor, listener, profile );
     }
 }

Modified: continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/RollbackReleaseProjectTask.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/RollbackReleaseProjectTask.java?rev=698412&r1=698411&r2=698412&view=diff
==============================================================================
--- continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/RollbackReleaseProjectTask.java
(original)
+++ continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/tasks/RollbackReleaseProjectTask.java
Tue Sep 23 18:55:19 2008
@@ -1,5 +1,6 @@
 package org.apache.maven.continuum.release.tasks;
 
+import org.apache.maven.continuum.model.system.Profile;
 import org.apache.maven.shared.release.ReleaseManagerListener;
 import org.apache.maven.shared.release.config.ReleaseDescriptor;
 
@@ -30,6 +31,11 @@
 {
     public RollbackReleaseProjectTask( String releaseId, ReleaseDescriptor descriptor, ReleaseManagerListener
listener )
     {
-        super( releaseId, descriptor, listener );
+        this( releaseId, descriptor, listener, null );
+    }
+    
+    public RollbackReleaseProjectTask( String releaseId, ReleaseDescriptor descriptor, ReleaseManagerListener
listener, Profile profile )
+    {
+        super( releaseId, descriptor, listener, profile );
     }
 }

Modified: continuum/trunk/continuum-release/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-release/src/main/resources/META-INF/plexus/components.xml?rev=698412&r1=698411&r2=698412&view=diff
==============================================================================
--- continuum/trunk/continuum-release/src/main/resources/META-INF/plexus/components.xml (original)
+++ continuum/trunk/continuum-release/src/main/resources/META-INF/plexus/components.xml Tue
Sep 23 18:55:19 2008
@@ -240,7 +240,7 @@
         </requirement>
         <requirement>
           <role>org.apache.maven.shared.release.config.ReleaseDescriptorStore</role>
-          <role-hint>properties</role-hint>
+          <role-hint>continuum-release-properties</role-hint>
           <field-name>configStore</field-name>
         </requirement>
         <requirement>
@@ -260,7 +260,7 @@
           <phase>map-development-versions</phase>
           <phase>rewrite-poms-for-release</phase>
           <phase>generate-release-poms</phase>
-          <phase>run-preparation-goals</phase>
+          <phase>run-release-prepare-goals</phase>
           <phase>scm-commit-release</phase>
           <phase>scm-tag</phase>
           <phase>rewrite-poms-for-development</phase>
@@ -271,7 +271,7 @@
         <performPhases>
           <phase>verify-completed-prepare-phases</phase>
           <phase>checkout-project-from-scm</phase>
-          <phase>run-perform-goals</phase>
+          <phase>run-release-perform-goals</phase>
         </performPhases>
         <rollbackPhases>
           <phase>generate-reactor-projects</phase>
@@ -304,7 +304,27 @@
         </requirement>
       </requirements>
     </component>
-
+    <component>
+      <role>org.apache.maven.shared.release.phase.ReleasePhase</role>
+      <role-hint>run-release-prepare-goals</role-hint>
+      <implementation>org.apache.continuum.release.phase.RunPrepareGoalsPhase</implementation>
+      <requirements>
+        <requirement>
+          <role>org.apache.continuum.utils.shell.ShellCommandHelper</role>
+        </requirement>
+      </requirements>
+    </component>
+    <component>
+      <role>org.apache.maven.shared.release.phase.ReleasePhase</role>
+      <role-hint>run-release-perform-goals</role-hint>
+      <implementation>org.apache.continuum.release.phase.RunPerformGoalsPhase</implementation>
+      <requirements>
+        <requirement>
+          <role>org.apache.continuum.utils.shell.ShellCommandHelper</role>
+        </requirement>
+      </requirements>
+    </component>
+    
     <!-- This needs to be removed once we can upgrade maven-project to 2.1-SNAPSHOT or
later. -->
     <component>
       <role>org.apache.maven.artifact.metadata.ArtifactMetadataSource</role>
@@ -318,12 +338,16 @@
           <role>org.apache.maven.artifact.factory.ArtifactFactory</role>
         </requirement>
         <requirement>
-          <role>org.apache.maven.artifact.repository.metadata.RepositoryMetadataManager</role
->
+          <role>org.apache.maven.artifact.repository.metadata.RepositoryMetadataManager</role>
         </requirement>
       </requirements>
     </component>
 
+    <component>
+      <role>org.apache.maven.shared.release.config.ReleaseDescriptorStore</role>
+      <role-hint>continuum-release-properties</role-hint>
+      <implementation>org.apache.continuum.release.config.ContinuumPropertiesReleaseDescriptorStore</implementation>
+    </component>
   </components>
 
 </component-set>

Modified: continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java?rev=698412&r1=698411&r2=698412&view=diff
==============================================================================
--- continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java
(original)
+++ continuum/trunk/continuum-release/src/test/java/org/apache/maven/continuum/release/executors/ReleaseTaskExecutorTest.java
Tue Sep 23 18:55:19 2008
@@ -21,6 +21,7 @@
 
 import java.io.File;
 
+import org.apache.continuum.release.config.ContinuumReleaseDescriptor;
 import org.apache.maven.continuum.release.ContinuumReleaseManager;
 import org.apache.maven.continuum.release.tasks.PerformReleaseProjectTask;
 import org.apache.maven.continuum.release.tasks.PrepareReleaseProjectTask;
@@ -98,7 +99,7 @@
         File testDir = new File( getBasedir(), "target/test-classes/test-dir" );
         FileUtils.deleteDirectory( testDir );
 
-        ReleaseDescriptor descriptor = new ReleaseDescriptor();
+        ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
         descriptor.setInteractive( false );
         descriptor.setScmSourceUrl( "scm:svn:file://localhost/" + scmPath + "/trunk" );
         descriptor.setWorkingDirectory( workDir.getAbsolutePath() );
@@ -140,7 +141,7 @@
         File testDir = new File( getBasedir(), "target/test-classes/test-dir" );
         FileUtils.deleteDirectory( testDir );
 
-        ReleaseDescriptor descriptor = new ReleaseDescriptor();
+        ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
         descriptor.setInteractive( false );
         descriptor.setScmSourceUrl( "scm:svn:file://localhost/" + scmPath + "/trunk" );
         descriptor.setWorkingDirectory( workDir.getAbsolutePath() );
@@ -185,7 +186,7 @@
         File testDir = new File( getBasedir(), "target/test-classes/test-dir" );
         FileUtils.deleteDirectory( testDir );
 
-        ReleaseDescriptor descriptor = new ReleaseDescriptor();
+        ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
         descriptor.setInteractive( false );
         descriptor.setScmSourceUrl( "scm:svn:file://localhost/" + scmPath + "/trunk" );
         descriptor.setWorkingDirectory( workDir.getAbsolutePath() );

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java?rev=698412&r1=698411&r2=698412&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePerformAction.java
Tue Sep 23 18:55:19 2008
@@ -20,8 +20,10 @@
  */
 
 import org.apache.continuum.model.repository.LocalRepository;
+import org.apache.continuum.release.config.ContinuumReleaseDescriptor;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.system.Profile;
 import org.apache.maven.continuum.release.ContinuumReleaseManager;
 import org.apache.maven.continuum.release.ContinuumReleaseManagerListener;
 import org.apache.maven.continuum.release.DefaultReleaseManagerListener;
@@ -31,6 +33,7 @@
 import org.apache.maven.shared.release.config.ReleaseDescriptor;
 
 import java.io.File;
+import java.util.List;
 
 /**
  * @author Edwin Punzalan
@@ -63,6 +66,10 @@
 
     private String projectGroupName = "";
 
+    private List<Profile> profiles;
+
+    private int profileId;
+
     public String inputFromScm()
         throws Exception
     {
@@ -79,6 +86,8 @@
 
         releaseId = "";
 
+        profiles = this.getContinuum().getProfileService().getAllProfiles();
+
         return SUCCESS;
     }
 
@@ -132,12 +141,20 @@
     {
         ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
 
-        ReleaseDescriptor descriptor = new ReleaseDescriptor();
+        ContinuumReleaseDescriptor descriptor = new ContinuumReleaseDescriptor();
         descriptor.setScmSourceUrl( scmUrl );
         descriptor.setScmUsername( scmUsername );
         descriptor.setScmPassword( scmPassword );
         descriptor.setScmReleaseLabel( scmTag );
         descriptor.setScmTagBase( scmTagBase );
+        
+        Profile profile = null;
+        
+        if ( profileId != -1 )
+        {
+            profile = getContinuum().getProfileService().getProfile( profileId );
+            descriptor.setEnvironments( releaseManager.getEnvironments( profile ) );
+        }
 
         do
         {
@@ -291,4 +308,25 @@
 
         return projectGroupName;
     }
+
+    public List<Profile> getProfiles()
+    {
+        return profiles;
+    }
+
+    public void setProfiles( List<Profile> profiles )
+    {
+        this.profiles = profiles;
+    }
+
+    public int getProfileId()
+    {
+        return profileId;
+    }
+
+    public void setProfileId( int profileId )
+    {
+        this.profileId = profileId;
+    }
+    
 }

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java?rev=698412&r1=698411&r2=698412&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ReleasePrepareAction.java
Tue Sep 23 18:55:19 2008
@@ -21,6 +21,7 @@
 
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.system.Profile;
 import org.apache.maven.continuum.release.ContinuumReleaseManager;
 import org.apache.maven.continuum.release.ContinuumReleaseManagerListener;
 import org.apache.maven.continuum.release.DefaultReleaseManagerListener;
@@ -85,6 +86,10 @@
 
     private String projectGroupName = "";
 
+    private List<Profile> profiles;
+
+    private int profileId;
+
     public String input()
         throws Exception
     {
@@ -138,6 +143,8 @@
 
         processProject( workingDirectory, "pom.xml" );
 
+        profiles = this.getContinuum().getProfileService().getAllProfiles();
+
         return SUCCESS;
     }
 
@@ -210,11 +217,18 @@
         {
             name = project.getArtifactId();
         }
+        
+        Profile profile = null;
+        
+        if ( profileId != -1 )
+        {
+            profile = getContinuum().getProfileService().getProfile( profileId );
+        }
 
         ContinuumReleaseManager releaseManager = getContinuum().getReleaseManager();
 
         releaseId =
-            releaseManager.prepare( project, getReleaseProperties(), getRelVersionMap(),
getDevVersionMap(), listener );
+            releaseManager.prepare( project, getReleaseProperties(), getRelVersionMap(),
getDevVersionMap(), listener, profile );
 
         return SUCCESS;
     }
@@ -526,4 +540,24 @@
 
         return projectGroupName;
     }
+
+    public List<Profile> getProfiles()
+    {
+        return profiles;
+    }
+
+    public void setProfiles( List<Profile> profiles )
+    {
+        this.profiles = profiles;
+    }
+
+    public int getProfileId()
+    {
+        return profileId;
+    }
+
+    public void setProfileId( int profileId )
+    {
+        this.profileId = profileId;
+    }
 }

Modified: continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ProfileAction.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ProfileAction.java?rev=698412&r1=698411&r2=698412&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ProfileAction.java
(original)
+++ continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/ProfileAction.java
Tue Sep 23 18:55:19 2008
@@ -37,6 +37,7 @@
 import org.codehaus.plexus.redback.xwork.interceptor.SecureActionBundle;
 import org.codehaus.plexus.redback.xwork.interceptor.SecureActionException;
 
+import com.opensymphony.webwork.ServletActionContext;
 import com.opensymphony.xwork.Preparable;
 
 /**
@@ -70,6 +71,8 @@
 
     private List<Installation> profileInstallations;
 
+    private String message;
+
     // -------------------------------------------------------
     //  Webwork Methods
     // -------------------------------------------------------
@@ -84,6 +87,13 @@
     public String list()
         throws Exception
     {
+        String errorMessage = ServletActionContext.getRequest().getParameter( "errorMessage"
);
+
+        if ( errorMessage != null )
+        {
+            addActionError( errorMessage );
+        }
+        
         this.profiles = profileService.getAllProfiles();
         return SUCCESS;
     }
@@ -149,10 +159,18 @@
 
     public String delete()
         throws Exception
-    {
-        profileService.deleteProfile( profile.getId() );
-        this.profiles = profileService.getAllProfiles();
-        return SUCCESS;
+    {   
+        try
+        {
+            profileService.deleteProfile( profile.getId() );
+            this.profiles = profileService.getAllProfiles();
+            return SUCCESS;
+        }
+        catch ( ProfileException e )
+        {
+            message = "profile.remove.error";
+            return ERROR;
+        }
     }
 
     public String confirmDelete()
@@ -283,4 +301,14 @@
     {
         this.installationId = installationId;
     }
+
+    public String getMessage()
+    {
+        return message;
+    }
+
+    public void setMessage( String message )
+    {
+        this.message = message;
+    }
 }

Modified: continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties?rev=698412&r1=698411&r2=698412&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
Tue Sep 23 18:55:19 2008
@@ -657,6 +657,20 @@
 releaseViewResult.noOutput=No Output
 releaseViewResult.projectName=Project Name
 releaseViewResult.releaseGoal=Release Goal
+releasePrepare.scmUsername.label=SCM Username
+releasePrepare.scmPassword.label=SCM Password
+releasePrepare.scmTag.label=SCM Tag
+releasePrepare.scmTagBase.label=SCM Tag Base
+releasePrepare.prepareGoals.label=Preparation Goals
+releasePrepare.buildEnvironment.label=Build Environment
+releasePerformFromScm.scmUrl.label=SCM Connection URL
+releasePerformFromScm.scmUsername.label=SCM Username
+releasePerformFromScm.scmPassword.label=SCM Password
+releasePerformFromScm.scmTag.label=SCM Tag
+releasePerformFromScm.scmTagBase.label=SCM Tag Base
+releasePerformFromScm.goals.label=Maven Arguments
+releasePerformFromScm.useReleaseProfile.label=Use Release Profile
+releasePerformFromScm.buildEnvironment.label=Build Environment
 
 # ----------------------------------------------------------------------
 # Page: User
@@ -700,6 +714,7 @@
 profile.no.installations = No installations available
 profile.name.already.exists = A Build Environment with the same name already exists
 profile.name.required = You must define a name.
+profile.remove.error = The Build Environment can't be removed, it is probably used by a build
definition.
 
 # ----------------------------------------------------------------------
 # Page: Installations List

Modified: continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml?rev=698412&r1=698411&r2=698412&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/xwork.xml (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/xwork.xml Tue Sep 23 18:55:19 2008
@@ -626,6 +626,12 @@
         <param name="namespace">/admin</param>
         <param name="method">list</param>
       </result>
+      <result name="error" type="redirect-action">
+        <param name="actionName">buildEnvList</param>
+        <param name="namespace">/admin</param>
+        <param name="method">list</param>
+        <param name="errorMessage">${message}</param>
+      </result>
     </action>      
     
     <action name="confirmDeleteBuildEnv" class="profileAdministration" method="confirmDelete">

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/profilesList.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/profilesList.jsp?rev=698412&r1=698411&r2=698412&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/profilesList.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/profilesList.jsp Tue
Sep 23 18:55:19 2008
@@ -33,6 +33,14 @@
       <ww:text name="profilesList.section.title"/>
     </h3>
 
+    <c:if test="${!empty actionErrors}">
+      <div class="errormessage">
+        <c:forEach items="${actionErrors}" var="actionError">
+          <p><ww:text name="${actionError}"/></p>
+        </c:forEach>
+      </div>
+    </c:if>
+        
     <ww:if test="${not empty profiles}">
     <ec:table items="profiles"
               var="profile"

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePerformFromScm.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePerformFromScm.jsp?rev=698412&r1=698411&r2=698412&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePerformFromScm.jsp
(original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePerformFromScm.jsp
Tue Sep 23 18:55:19 2008
@@ -31,15 +31,17 @@
         <ww:hidden name="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:password label="SCM Password" name="scmPassword"/>
-            <ww:textfield label="SCM Tag" name="scmTag"/>
+            <ww:textfield label="%{getText('releasePerformFromScm.scmUrl.label')}" name="scmUrl"/>
+            <ww:textfield label="%{getText('releasePerformFromScm.scmUsername.label')}"
name="scmUsername"/>
+            <ww:password label="%{getText('releasePerformFromScm.scmPassword.label')}"
name="scmPassword"/>
+            <ww:textfield label="%{getText('releasePerformFromScm.scmTag.label')}" name="scmTag"/>
             <c:if test="${!empty (scmTagBase)}">
-              <ww:textfield label="SCM Tag Base" name="scmTagBase"/>
+              <ww:textfield label="%{getText('releasePerformFromScm.scmTagBase.label')}"
name="scmTagBase"/>
             </c:if>
-            <ww:textfield label="Maven Arguments" name="goals" value="clean deploy"/>
-            <ww:checkbox label="Use Release Profile" name="useReleaseProfile" value="true"/>
+            <ww:textfield label="%{getText('releasePerformFromScm.goals.label')}" name="goals"
value="clean deploy"/>
+            <ww:checkbox label="%{getText('releasePerformFromScm.useReleaseProfile.label')}"
name="useReleaseProfile" value="true"/>
+            <ww:select label="%{getText('releasePerformFromScm.buildEnvironment.label')}"
name="profileId" list="profiles" listValue="name" 
+                       listKey="id" headerKey="-1" headerValue=""/>
           </table>
         </div>
         <ww:submit/>

Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePrepare.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePrepare.jsp?rev=698412&r1=698411&r2=698412&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePrepare.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/releasePrepare.jsp Tue Sep
23 18:55:19 2008
@@ -32,14 +32,16 @@
         <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 Username" name="scmUsername" required="true"/>
-            <ww:password label="SCM Password" name="scmPassword" required="true"/>
-            <ww:textfield label="SCM Tag" name="scmTag" required="true"/>
+            <ww:textfield label="%{getText('releasePrepare.scmUsername.label')}" name="scmUsername"
required="true"/>
+            <ww:password label="%{getText('releasePrepare.scmPassword.label')}" name="scmPassword"
required="true"/>
+            <ww:textfield label="%{getText('releasePrepare.scmTag.label')}" name="scmTag"
required="true"/>
             <c:if test="${!empty (scmTagBase)}">
-              <ww:textfield label="SCM Tag Base" name="scmTagBase"/>
+              <ww:textfield label="%{getText('releasePrepare.scmTagBase.label')}" name="scmTagBase"/>
             </c:if>
-            <ww:textfield label="Preparation Goals" name="prepareGoals" required="true"/>
-           </table>
+            <ww:textfield label="%{getText('releasePrepare.prepareGoals.label')}" name="prepareGoals"
required="true"/>
+            <ww:select label="%{getText('releasePrepare.buildEnvironment.label')}" name="profileId"
list="profiles" listValue="name" 
+                       listKey="id" headerKey="-1" headerValue=""/>
+          </table>
         </div>
 
         <ww:iterator value="projects">



Mime
View raw message