continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r179983 - in /maven/continuum/trunk/continuum-core/src/main: java/org/apache/maven/continuum/ java/org/apache/maven/continuum/core/ java/org/apache/maven/continuum/core/action/ resources/META-INF/plexus/
Date Sat, 04 Jun 2005 13:08:37 GMT
Author: jvanzyl
Date: Sat Jun  4 06:08:35 2005
New Revision: 179983

URL: http://svn.apache.org/viewcvs?rev=179983&view=rev
Log:
o first switch over to using a set of actions to form an activity

Added:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadata.java
Removed:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/BuildProjectsFromMetadataAction.java
Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/ContinuumCore.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/DefaultContinuumCore.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckOutProjectContinuumAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromScmContinuumAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java
    maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=179983&r1=179982&r2=179983&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Sat Jun  4 06:08:35 2005
@@ -17,7 +17,8 @@
  */
 
 import org.apache.maven.continuum.core.ContinuumCore;
-import org.apache.maven.continuum.core.action.BuildProjectsFromMetadataAction;
+import org.apache.maven.continuum.core.action.CreateProjectsFromMetadata;
+import org.apache.maven.continuum.core.action.AbstractContinuumAction;
 import org.apache.maven.continuum.execution.ant.AntBuildExecutor;
 import org.apache.maven.continuum.execution.maven.m1.MavenOneBuildExecutor;
 import org.apache.maven.continuum.execution.maven.m2.MavenTwoBuildExecutor;
@@ -336,33 +337,47 @@
     {
         Map context = new HashMap();
 
-        context.put( BuildProjectsFromMetadataAction.KEY_PROJECT_BUILDER_ID, MavenTwoContinuumProjectBuilder.ID
);
+        context.put( CreateProjectsFromMetadata.KEY_PROJECT_BUILDER_ID, MavenTwoContinuumProjectBuilder.ID
);
 
-        context.put( BuildProjectsFromMetadataAction.KEY_URL, metadataUrl );
+        context.put( CreateProjectsFromMetadata.KEY_URL, metadataUrl );
+
+        context.put( CreateProjectsFromMetadata.KEY_WORKING_DIRECTORY, core.getWorkingDirectory()
);
 
         try
         {
-            actionManager.lookup( "build-projects-from-metadata" ).execute( context );
+            // ----------------------------------------------------------------------
+            // During the execution of the this action we may find that the metadata
+            // isn't good enough for the following reasons:
+            //
+            // 1) No scm element (repository element for m1)
+            // 2) Invalid scm element (repository element for m1)
+            // 3) No ciManagement (m2)
+            // 4) Invalid ciManagement element (m2)
+            // ----------------------------------------------------------------------
+
+            actionManager.lookup( "create-projects-from-metadata" ).execute( context );
 
-            ContinuumProjectBuildingResult result = (ContinuumProjectBuildingResult) context.get(
BuildProjectsFromMetadataAction.KEY_PROJECT_BUILDING_RESULT );
+            ContinuumProjectBuildingResult result = (ContinuumProjectBuildingResult) context.get(
CreateProjectsFromMetadata.KEY_PROJECT_BUILDING_RESULT );
 
             List projects = result.getProjects();
 
             for ( Iterator i = projects.iterator(); i.hasNext(); )
             {
+                ContinuumProject project = (ContinuumProject) i.next();
+
+                context.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT, project );
+
                 actionManager.lookup( "validate-project" ).execute( context );
 
                 actionManager.lookup( "store-project" ).execute( context );
 
-                actionManager.lookup( "add-project-checkout-queue" ).execute( context );
+                actionManager.lookup( "add-project-to-checkout-queue" ).execute( context
);
             }
         }
         catch ( Exception e )
         {
             throw new ContinuumException( "Error adding m2 project: ", e );
         }
-
-        //core.addProjectsFromUrl( metadataUrl, MavenTwoContinuumProjectBuilder.ID );
     }
 
     public void addMavenTwoProject( MavenTwoProject project )

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/ContinuumCore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/ContinuumCore.java?rev=179983&r1=179982&r2=179983&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/ContinuumCore.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/ContinuumCore.java
Sat Jun  4 06:08:35 2005
@@ -19,13 +19,20 @@
 import java.net.URL;
 import java.util.Collection;
 import java.util.Properties;
+import java.io.File;
 
 import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
+import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
+import org.apache.maven.continuum.execution.manager.BuildExecutorManager;
 import org.apache.maven.continuum.project.ContinuumBuild;
 import org.apache.maven.continuum.project.ContinuumBuildResult;
 import org.apache.maven.continuum.project.ContinuumProject;
+import org.apache.maven.continuum.project.builder.manager.ContinuumProjectBuilderManager;
 import org.apache.maven.continuum.scm.CheckOutScmResult;
+import org.apache.maven.continuum.scm.ContinuumScm;
+import org.codehaus.plexus.taskqueue.TaskQueue;
 
 /**
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
@@ -114,4 +121,22 @@
 
     ContinuumBuildExecutor getBuildExecutor( String id )
         throws ContinuumException;
+
+    // ----------------------------------------------------------------------
+    // Accessors for actions
+    // ----------------------------------------------------------------------
+
+    ContinuumStore getStore();
+
+    ContinuumScm getScm();
+
+    ContinuumProjectBuilderManager getProjectBuilderManager();
+
+    BuildExecutorManager getBuildExecutorManager();
+
+    TaskQueue getBuildQueue();
+
+    TaskQueue getCheckOutQueue();
+
+    String getWorkingDirectory();
 }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/DefaultContinuumCore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/DefaultContinuumCore.java?rev=179983&r1=179982&r2=179983&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/DefaultContinuumCore.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/DefaultContinuumCore.java
Sat Jun  4 06:08:35 2005
@@ -27,6 +27,7 @@
 import java.util.Properties;
 
 import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
 import org.apache.maven.continuum.buildqueue.BuildProjectTask;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutorException;
@@ -106,15 +107,19 @@
      */
     private ContinuumScm scm;
 
+    // ----------------------------------------------------------------------
+    // Configuration
+    // ----------------------------------------------------------------------
+
     /**
-     * @requirement
+     * @configuration
      */
-    private String appHome;
+    private String workingDirectory;
 
     /**
      * @configuration
      */
-    private String workingDirectory;
+    private String appHome;
 
     // ----------------------------------------------------------------------
     //
@@ -803,4 +808,44 @@
 
         return new ContinuumException( message, cause );
     }
+
+    // ----------------------------------------------------------------------
+    // Accessors
+    // ----------------------------------------------------------------------
+
+    public ContinuumStore getStore()
+    {
+        return store;
+    }
+
+    public ContinuumScm getScm()
+    {
+        return scm;
+    }
+
+    public ContinuumProjectBuilderManager getProjectBuilderManager()
+    {
+        return projectBuilderManager;
+    }
+
+    public BuildExecutorManager getBuildExecutorManager()
+    {
+        return buildExecutorManager;
+    }
+
+    public TaskQueue getBuildQueue()
+    {
+        return buildQueue;
+    }
+
+    public TaskQueue getCheckOutQueue()
+    {
+        return checkOutQueue;
+    }
+
+    public String getWorkingDirectory()
+    {
+        return workingDirectory;
+    }
 }
+

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java?rev=179983&r1=179982&r2=179983&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
Sat Jun  4 06:08:35 2005
@@ -16,21 +16,23 @@
  * limitations under the License.
  */
 
-import java.io.File;
-import java.util.Map;
-
 import org.apache.maven.continuum.core.ContinuumCore;
+import org.apache.maven.continuum.execution.manager.BuildExecutorManager;
 import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
 import org.apache.maven.continuum.project.ContinuumBuild;
 import org.apache.maven.continuum.project.ContinuumProject;
+import org.apache.maven.continuum.project.builder.manager.ContinuumProjectBuilderManager;
 import org.apache.maven.continuum.scm.CheckOutScmResult;
 import org.apache.maven.continuum.scm.ContinuumScm;
 import org.apache.maven.continuum.scm.UpdateScmResult;
 import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
-
 import org.codehaus.plexus.action.Action;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.taskqueue.TaskQueue;
+
+import java.io.File;
+import java.util.Map;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -46,6 +48,10 @@
 
     public final static String KEY_PROJECT_ID = "projectId";
 
+    public final static String KEY_PROJECT = "project";
+
+    public final static String KEY_UNVALIDATED_PROJECT = "project";
+
     public final static String KEY_BUILD_ID = "buildId";
 
     public static final String KEY_WORKING_DIRECTORY = "workingDirectory";
@@ -66,19 +72,10 @@
     private ContinuumCore core;
 
     /**
-     * @plexus.requirement
-     */
-    private ContinuumStore store;
-
-    /**
-     * @plexus.requirement
+     * @requirement
      */
-    private ContinuumScm scm;
+    private ContinuumNotificationDispatcher notificationDispatcher;
 
-    /**
-     * @plexus.requirement
-     */
-    private ContinuumNotificationDispatcher notifier;
 
     // ----------------------------------------------------------------------
     //
@@ -91,17 +88,37 @@
 
     protected ContinuumStore getStore()
     {
-        return store;
+        return core.getStore();
     }
 
     protected ContinuumScm getScm()
     {
-        return scm;
+        return core.getScm();
     }
 
     protected ContinuumNotificationDispatcher getNotifier()
     {
-        return notifier;
+        return notificationDispatcher;
+    }
+
+    protected ContinuumProjectBuilderManager getProjectBuilderManager()
+    {
+        return core.getProjectBuilderManager();
+    }
+
+    protected TaskQueue getBuildQueue()
+    {
+        return core.getBuildQueue();
+    }
+
+    protected TaskQueue getCheckOutQueue()
+    {
+        return core.getCheckOutQueue();
+    }
+
+    protected BuildExecutorManager getBuildExecutorManager()
+    {
+        return core.getBuildExecutorManager();
     }
 
     // ----------------------------------------------------------------------
@@ -131,6 +148,13 @@
     {
         return getStore().getProject( getProjectId( context ) );
     }
+
+    protected ContinuumProject getUnvalidatedProject( Map context )
+        throws ContinuumStoreException
+    {
+        return ((ContinuumProject) getObject( context, KEY_UNVALIDATED_PROJECT ) );
+    }
+
 
     protected ContinuumBuild getBuild( Map context )
         throws ContinuumStoreException

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java?rev=179983&r1=179982&r2=179983&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AddProjectToCheckOutQueueAction.java
Sat Jun  4 06:08:35 2005
@@ -3,13 +3,11 @@
  */
 package org.apache.maven.continuum.core.action;
 
-import java.io.File;
-import java.util.Map;
-
 import org.apache.maven.continuum.project.ContinuumProject;
 import org.apache.maven.continuum.scm.queue.CheckOutTask;
 
-import org.codehaus.plexus.taskqueue.TaskQueue;
+import java.io.File;
+import java.util.Map;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -18,19 +16,17 @@
 public class AddProjectToCheckOutQueueAction
     extends AbstractContinuumAction
 {
-    /**
-     * @plexus.requirement
-     */
-    private TaskQueue checkOutQueue;
-
     public void execute( Map context )
         throws Exception
     {
         ContinuumProject project = getProject( context );
 
-        CheckOutTask checkOutTask = new CheckOutTask( project.getId(),
-                                                      new File( project.getWorkingDirectory()
) );
+        System.out.println( "getProjectId( context ) = " + getProjectId( context ) );
+
+        System.out.println( "getProject( context ) = " + getProject( context ) );
+
+        CheckOutTask checkOutTask = new CheckOutTask( project.getId(), new File( project.getWorkingDirectory()
) );
 
-        checkOutQueue.put( checkOutTask );
+        getCheckOutQueue().put( checkOutTask );
     }
 }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckOutProjectContinuumAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckOutProjectContinuumAction.java?rev=179983&r1=179982&r2=179983&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckOutProjectContinuumAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckOutProjectContinuumAction.java
Sat Jun  4 06:08:35 2005
@@ -16,11 +16,11 @@
  * limitations under the License.
  */
 
-import java.io.File;
-import java.util.Map;
-
 import org.apache.maven.continuum.project.ContinuumProject;
 import org.apache.maven.continuum.scm.CheckOutScmResult;
+
+import java.io.File;
+import java.util.Map;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>

Added: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadata.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadata.java?rev=179983&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadata.java
(added)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateProjectsFromMetadata.java
Sat Jun  4 06:08:35 2005
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2005 Your Corporation. All Rights Reserved.
+ */
+package org.apache.maven.continuum.core.action;
+
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuilder;
+import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
+
+import java.net.URL;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
+ * @version $Id: BuildProjectsFromMetadataAction.java 179783 2005-06-03 13:04:54Z jvanzyl
$
+ */
+public class CreateProjectsFromMetadata
+    extends AbstractContinuumAction
+{
+    public static final String KEY_URL = "url";
+
+    public static final String KEY_PROJECT_BUILDER_ID = "builderId";
+
+    public static final String KEY_PROJECT_BUILDING_RESULT = "projectBuildingResult";
+
+    public  void execute( Map context )
+        throws Exception
+    {
+        String projectBuilderId = getString( context, KEY_PROJECT_BUILDER_ID );
+
+        URL url = new URL( getString( context, KEY_URL ) );
+
+        ContinuumProjectBuilder projectBuilder = getProjectBuilderManager().getProjectBuilder(
projectBuilderId );
+
+        ContinuumProjectBuildingResult result = projectBuilder.buildProjectsFromMetadata(
url );
+
+        context.put( KEY_PROJECT_BUILDING_RESULT, result );
+    }
+}

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java?rev=179983&r1=179982&r2=179983&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
Sat Jun  4 06:08:35 2005
@@ -16,15 +16,16 @@
  * limitations under the License.
  */
 
-import java.util.Collection;
-import java.util.Map;
-
 import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
 import org.apache.maven.continuum.project.ContinuumBuildResult;
 import org.apache.maven.continuum.project.ContinuumProject;
 import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.apache.maven.continuum.scm.UpdateScmResult;
+
+import java.util.Collection;
+import java.util.Map;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java?rev=179983&r1=179982&r2=179983&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java
Sat Jun  4 06:08:35 2005
@@ -3,12 +3,11 @@
  */
 package org.apache.maven.continuum.core.action;
 
-import java.io.File;
-import java.util.Map;
-
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.project.ContinuumProject;
-import org.apache.maven.continuum.store.ContinuumStore;
+
+import java.io.File;
+import java.util.Map;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -17,26 +16,30 @@
 public class StoreProjectAction
     extends AbstractContinuumAction
 {
-    /**
-     * @plexus.requirement
-     */
-    private ContinuumStore store;
-
     public void execute( Map context )
         throws Exception
     {
-        ContinuumProject project = getProject( context );
+        ContinuumProject project = getUnvalidatedProject( context );
 
         File workingDirectory = getWorkingDirectory( context );
 
-        String projectId = store.addProject( project.getName(),
-                                             project.getScmUrl(),
-                                             project.getNagEmailAddress(),
-                                             project.getVersion(),
-                                             project.getCommandLineArguments(),
-                                             project.getExecutorId(),
-                                             null,
-                                             project.getConfiguration() );
+        // ----------------------------------------------------------------------
+        //
+        // ----------------------------------------------------------------------
+
+
+        String projectId = getStore().addProject( project.getName(),
+                                                  project.getScmUrl(),
+                                                  project.getNagEmailAddress(),
+                                                  project.getVersion(),
+                                                  project.getCommandLineArguments(),
+                                                  project.getExecutorId(),
+                                                  null,
+                                                  project.getConfiguration() );
+
+        System.out.println( "projectId = " + projectId );
+
+        context.put( KEY_PROJECT_ID, projectId );
 
         // ----------------------------------------------------------------------
         // Set the working directory
@@ -54,5 +57,7 @@
         // figure out what it is.
 
         project.setWorkingDirectory( projectWorkingDirectory.getAbsolutePath() );
+        
+        getStore().setWorkingDirectory( projectId, projectWorkingDirectory.getAbsolutePath()
);
     }
 }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromScmContinuumAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromScmContinuumAction.java?rev=179983&r1=179982&r2=179983&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromScmContinuumAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateProjectFromScmContinuumAction.java
Sat Jun  4 06:08:35 2005
@@ -16,10 +16,10 @@
  * limitations under the License.
  */
 
-import java.util.Map;
-
 import org.apache.maven.continuum.project.ContinuumProject;
 import org.apache.maven.continuum.scm.UpdateScmResult;
+
+import java.util.Map;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java?rev=179983&r1=179982&r2=179983&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java
Sat Jun  4 06:08:35 2005
@@ -3,16 +3,12 @@
  */
 package org.apache.maven.continuum.core.action;
 
-import java.util.Map;
-
 import org.apache.maven.continuum.ContinuumException;
-import org.apache.maven.continuum.core.ContinuumCore;
-import org.apache.maven.continuum.execution.manager.BuildExecutorManager;
 import org.apache.maven.continuum.project.ContinuumProject;
-import org.apache.maven.continuum.store.ContinuumStore;
-
 import org.codehaus.plexus.util.StringUtils;
 
+import java.util.Map;
+
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
@@ -20,37 +16,22 @@
 public class ValidateProject
     extends AbstractContinuumAction
 {
-    /**
-     * @plexus.requirement
-     */
-    private BuildExecutorManager buildExecutorManager;
-
-    /**
-     * @plexus.requirement
-     */
-    private ContinuumCore core;
-
-    /**
-     * @plexus.requirement
-     */
-    private ContinuumStore store;
-
     public void execute( Map context )
         throws Exception
     {
-        ContinuumProject project = getProject( context );
+        ContinuumProject project = getUnvalidatedProject( context );
 
         // ----------------------------------------------------------------------
         // Make sure that the builder id is correct before starting to check
         // stuff out
         // ----------------------------------------------------------------------
 
-        if ( !buildExecutorManager.hasBuildExecutor( project.getExecutorId() ) )
+        if ( !getBuildExecutorManager().hasBuildExecutor( project.getExecutorId() ) )
         {
             throw new ContinuumException( "No such executor with id '" + project.getExecutorId()
+ "'." );
         }
 
-        if ( store.getProjectByName( project.getName() ) != null )
+        if ( getStore().getProjectByName( project.getName() ) != null )
         {
             throw new ContinuumException( "A project with the name '" + project.getName()
+ "' already exist." );
         }

Modified: maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml?rev=179983&r1=179982&r2=179983&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
Sat Jun  4 06:08:35 2005
@@ -512,41 +512,84 @@
       <role>org.codehaus.plexus.action.Action</role>
       <role-hint>add-project-to-checkout-queue</role-hint>
       <implementation>org.apache.maven.continuum.core.action.AddProjectToCheckOutQueueAction</implementation>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.continuum.core.ContinuumCore</role>
+        </requirement>
+      </requirements>
     </component>
     <component>
       <role>org.codehaus.plexus.action.Action</role>
-      <role-hint>build-projects-from-metadata</role-hint>
-      <implementation>org.apache.maven.continuum.core.action.BuildProjectsFromMetadataAction</implementation>
+      <role-hint>create-projects-from-metadata</role-hint>
+      <implementation>org.apache.maven.continuum.core.action.CreateProjectsFromMetadata</implementation>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.continuum.core.ContinuumCore</role>
+        </requirement>
+      </requirements>
     </component>
     <component>
       <role>org.codehaus.plexus.action.Action</role>
       <role-hint>checkout-project</role-hint>
       <implementation>org.apache.maven.continuum.core.action.CheckOutProjectContinuumAction</implementation>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.continuum.core.ContinuumCore</role>
+        </requirement>
+      </requirements>
     </component>
     <component>
       <role>org.codehaus.plexus.action.Action</role>
       <role-hint>build-project</role-hint>
       <implementation>org.apache.maven.continuum.core.action.ExecuteBuilderContinuumAction</implementation>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.continuum.core.ContinuumCore</role>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.continuum.notification.ContinuumNotificationDispatcher</role>
+        </requirement>
+      </requirements>
     </component>
     <component>
       <role>org.codehaus.plexus.action.Action</role>
       <role-hint>store-project</role-hint>
       <implementation>org.apache.maven.continuum.core.action.StoreProjectAction</implementation>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.continuum.core.ContinuumCore</role>
+        </requirement>
+      </requirements>
     </component>
     <component>
       <role>org.codehaus.plexus.action.Action</role>
-      <role-hint></role-hint>
-      <implementation>org.apache.maven.continuum.core.action.</implementation>
+      <role-hint>validate-project</role-hint>
+      <implementation>org.apache.maven.continuum.core.action.ValidateProject</implementation>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.continuum.core.ContinuumCore</role>
+        </requirement>
+      </requirements>
     </component>
     <component>
       <role>org.codehaus.plexus.action.Action</role>
       <role-hint>update-project</role-hint>
       <implementation>org.apache.maven.continuum.core.action.UpdateProjectFromScmContinuumAction</implementation>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.continuum.core.ContinuumCore</role>
+        </requirement>
+      </requirements>
     </component>
     <component>
       <role>org.codehaus.plexus.action.Action</role>
       <role-hint>update-project-metadata</role-hint>
       <implementation>org.apache.maven.continuum.core.action.UpdateProjectMetadataContinuumAction</implementation>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.continuum.core.ContinuumCore</role>
+        </requirement>
+      </requirements>
     </component>
 
   </components>



Mime
View raw message