You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@continuum.apache.org by br...@apache.org on 2008/04/27 15:46:13 UTC

svn commit: r651947 - in /continuum/branches/builder: ./ continuum-api/src/main/java/org/apache/maven/continuum/execution/ continuum-base/ continuum-base/continuum-scm/ continuum-base/continuum-scm/src/ continuum-base/continuum-scm/src/main/ continuum-...

Author: brett
Date: Sun Apr 27 06:46:10 2008
New Revision: 651947

URL: http://svn.apache.org/viewvc?rev=651947&view=rev
Log:
[CONTINUUM-1745] start to move the SCM code into an isolated module

Added:
    continuum/branches/builder/continuum-base/   (with props)
    continuum/branches/builder/continuum-base/continuum-scm/   (with props)
    continuum/branches/builder/continuum-base/continuum-scm/pom.xml   (with props)
    continuum/branches/builder/continuum-base/continuum-scm/src/
    continuum/branches/builder/continuum-base/continuum-scm/src/main/
    continuum/branches/builder/continuum-base/continuum-scm/src/main/java/
    continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/
    continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/
    continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/
    continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/
    continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/ContinuumScm.java   (with props)
    continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/ContinuumScmConfiguration.java   (with props)
    continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/DefaultContinuumScm.java
      - copied, changed from r647661, continuum/branches/builder/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java
    continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/manager/
    continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/manager/ScmManager.java   (with props)
    continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/manager/Slf4jScmLogger.java   (with props)
    continuum/branches/builder/continuum-base/continuum-scm/src/main/resources/
    continuum/branches/builder/continuum-base/continuum-scm/src/main/resources/META-INF/
    continuum/branches/builder/continuum-base/continuum-scm/src/main/resources/META-INF/spring-context.xml   (with props)
    continuum/branches/builder/continuum-base/continuum-scm/src/test/
    continuum/branches/builder/continuum-base/continuum-scm/src/test/java/
    continuum/branches/builder/continuum-base/continuum-scm/src/test/java/org/
    continuum/branches/builder/continuum-base/continuum-scm/src/test/java/org/apache/
    continuum/branches/builder/continuum-base/continuum-scm/src/test/java/org/apache/continuum/
    continuum/branches/builder/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/
    continuum/branches/builder/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/manager/
    continuum/branches/builder/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/manager/ScmManagerTest.java   (with props)
    continuum/branches/builder/continuum-base/continuum-scm/src/test/resources/
    continuum/branches/builder/continuum-base/continuum-scm/src/test/resources/org/
    continuum/branches/builder/continuum-base/continuum-scm/src/test/resources/org/apache/
    continuum/branches/builder/continuum-base/continuum-scm/src/test/resources/org/apache/continuum/
    continuum/branches/builder/continuum-base/continuum-scm/src/test/resources/org/apache/continuum/scm/
    continuum/branches/builder/continuum-base/continuum-scm/src/test/resources/org/apache/continuum/scm/manager/
    continuum/branches/builder/continuum-base/continuum-scm/src/test/resources/org/apache/continuum/scm/manager/ScmManagerTest.xml   (with props)
    continuum/branches/builder/continuum-base/pom.xml   (with props)
Removed:
    continuum/branches/builder/continuum-core/src/main/java/org/apache/maven/continuum/scm/
    continuum/branches/builder/continuum-core/src/test/java/org/apache/maven/continuum/execution/shell/
    continuum/branches/builder/continuum-core/src/test/java/org/apache/maven/continuum/scm/
    continuum/branches/builder/continuum-core/src/test/java/org/apache/maven/continuum/utils/shell/
Modified:
    continuum/branches/builder/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java
    continuum/branches/builder/continuum-core/pom.xml
    continuum/branches/builder/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
    continuum/branches/builder/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
    continuum/branches/builder/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateWorkingDirectoryFromScmContinuumAction.java
    continuum/branches/builder/continuum-core/src/main/resources/META-INF/plexus/components.xml
    continuum/branches/builder/continuum-webapp/src/main/webapp/WEB-INF/applicationContext.xml
    continuum/branches/builder/pom.xml

Modified: continuum/branches/builder/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/builder/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java?rev=651947&r1=651946&r2=651947&view=diff
==============================================================================
--- continuum/branches/builder/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java (original)
+++ continuum/branches/builder/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java Sun Apr 27 06:46:10 2008
@@ -33,9 +33,11 @@
 {
     String ROLE = ContinuumBuildExecutor.class.getName();
 
+    // TODO: stream the build output
     ContinuumBuildExecutionResult build( Project project, BuildDefinition buildDefinition, File buildOutput )
         throws ContinuumBuildExecutorException;
 
+    // TODO: rename to be clearer
     void updateProjectFromCheckOut( File workingDirectory, Project project, BuildDefinition buildDefinition )
         throws ContinuumBuildExecutorException;
 
@@ -43,8 +45,10 @@
 
     void killProcess( Project project );
 
+    // TODO: are these part of the builder interface, or a separate project/build definition interface?
     List getDeployableArtifacts( Project project, File workingDirectory, BuildDefinition buildDefinition )
         throws ContinuumBuildExecutorException;
 
+    //TODO: Move as a plugin
     void backupTestFiles( Project project, int buildId );
 }

Propchange: continuum/branches/builder/continuum-base/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Apr 27 06:46:10 2008
@@ -0,0 +1,4 @@
+target
+.classpath
+.project
+.settings

Propchange: continuum/branches/builder/continuum-base/continuum-scm/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Apr 27 06:46:10 2008
@@ -0,0 +1,3 @@
+.classpath
+target
+.project

Added: continuum/branches/builder/continuum-base/continuum-scm/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/builder/continuum-base/continuum-scm/pom.xml?rev=651947&view=auto
==============================================================================
--- continuum/branches/builder/continuum-base/continuum-scm/pom.xml (added)
+++ continuum/branches/builder/continuum-base/continuum-scm/pom.xml Sun Apr 27 06:46:10 2008
@@ -0,0 +1,54 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <artifactId>continuum-base</artifactId>
+    <groupId>org.apache.continuum</groupId>
+    <version>1.2-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>continuum-scm</artifactId>
+  <name>Continuum :: SCM</name>
+  <!--  TODO: move versions to dependency management -->
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.scm</groupId>
+      <artifactId>maven-scm-api</artifactId>
+      <version>${maven-scm.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+      <version>1.5.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-context</artifactId>
+      <version>${spring.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-simple</artifactId>
+      <version>1.5.0</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.scm</groupId>
+      <artifactId>maven-scm-provider-svnexe</artifactId>
+      <version>${maven-scm.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+      <version>1.4</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+      <version>2.1</version>
+    </dependency>
+  </dependencies>
+</project>

Propchange: continuum/branches/builder/continuum-base/continuum-scm/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/ContinuumScm.java
URL: http://svn.apache.org/viewvc/continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/ContinuumScm.java?rev=651947&view=auto
==============================================================================
--- continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/ContinuumScm.java (added)
+++ continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/ContinuumScm.java Sun Apr 27 06:46:10 2008
@@ -0,0 +1,59 @@
+package org.apache.continuum.scm;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.io.IOException;
+
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.command.checkout.CheckOutScmResult;
+import org.apache.maven.scm.command.update.UpdateScmResult;
+import org.apache.maven.scm.manager.NoSuchScmProviderException;
+import org.apache.maven.scm.repository.ScmRepositoryException;
+
+/**
+ * Component that manages SCM interactions and checkouts within Continuum.
+ */
+public interface ContinuumScm
+{
+    /**
+     * Check out a working copy for a project.
+     * 
+     * @param configuration the configuration for the working copy and SCM
+     * @return the result of the check out
+     * @throws IOException if there is a problem writing to the working copy location
+     * @throws NoSuchScmProviderException if there is a problem with the configuration
+     * @throws ScmRepositoryException if there is a problem with the configuration
+     * @throws ScmException if there is a problem checking out
+     */
+    CheckOutScmResult checkout( ContinuumScmConfiguration configuration )
+        throws IOException, ScmRepositoryException, NoSuchScmProviderException, ScmException;
+
+    /**
+     * Update a working copy for a project.
+     * 
+     * @param configuration the configuration for the working copy and SCM
+     * @return the result of the update
+     * @throws NoSuchScmProviderException if there is a problem with the configuration
+     * @throws ScmRepositoryException if there is a problem with the configuration
+     * @throws ScmException if there is a problem updating
+     */
+    UpdateScmResult update( ContinuumScmConfiguration config )
+        throws ScmRepositoryException, NoSuchScmProviderException, ScmException;
+}

Propchange: continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/ContinuumScm.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/ContinuumScm.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/ContinuumScmConfiguration.java
URL: http://svn.apache.org/viewvc/continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/ContinuumScmConfiguration.java?rev=651947&view=auto
==============================================================================
--- continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/ContinuumScmConfiguration.java (added)
+++ continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/ContinuumScmConfiguration.java Sun Apr 27 06:46:10 2008
@@ -0,0 +1,142 @@
+package org.apache.continuum.scm;
+
+import java.io.File;
+import java.util.Date;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * Configuration for a project's source control.
+ * 
+ * @todo JAXB for persistence
+ */
+public class ContinuumScmConfiguration
+{
+    /** The SCM URL, in the format specified by Maven SCM. */
+    private String url;
+
+    /**
+     * The SCM username to use in connecting.
+     */
+    private String username;
+
+    /**
+     * The SCM password to use in connecting.
+     * 
+     * @todo using some service to obtain this rather than configuring it would be preferable
+     */
+    private String password;
+
+    /** The tag, branch, or equivalent to check out from. */
+    private String tag;
+
+    /**
+     * The location of the working directory.
+     * 
+     * @todo is this a File that is absolute, or is it a relative path under the working directories? How will JAXB
+     *       manage? Don't want to store absolute path in the config unless that's what the user configured, so the base
+     *       can be relocated.
+     */
+    private File workingDirectory;
+
+    /**
+     * For SCM clients that support it, use cached credentials on the system to avoid needing to pass them in.
+     * 
+     * @todo using some service to obtain them rather than configuring it would be preferable
+     */
+    private boolean useCredentialsCache;
+
+    /**
+     * What was the last time this checkout was updated.
+     * 
+     * @todo we need to improve on the techniques to achieve this
+     */
+    private Date latestUpdateDate;
+
+    public String getUsername()
+    {
+        return username;
+    }
+
+    public void setUsername( String username )
+    {
+        this.username = username;
+    }
+
+    public String getPassword()
+    {
+        return password;
+    }
+
+    public void setPassword( String password )
+    {
+        this.password = password;
+    }
+
+    public String getTag()
+    {
+        return tag;
+    }
+
+    public void setTag( String tag )
+    {
+        this.tag = tag;
+    }
+
+    public boolean isUseCredentialsCache()
+    {
+        return useCredentialsCache;
+    }
+
+    public void setUseCredentialsCache( boolean useCredentialsCache )
+    {
+        this.useCredentialsCache = useCredentialsCache;
+    }
+
+    public String getUrl()
+    {
+        return url;
+    }
+
+    public void setUrl( String url )
+    {
+        this.url = url;
+    }
+
+    public File getWorkingDirectory()
+    {
+        return workingDirectory;
+    }
+
+    public void setWorkingDirectory( File workingDirectory )
+    {
+        this.workingDirectory = workingDirectory;
+    }
+
+    public Date getLatestUpdateDate()
+    {
+        return latestUpdateDate;
+    }
+    
+    public void setLatestUpdateDate( Date latestUpdateDate )
+    {
+        this.latestUpdateDate = latestUpdateDate;
+    }
+}

Propchange: continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/ContinuumScmConfiguration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/ContinuumScmConfiguration.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/DefaultContinuumScm.java (from r647661, continuum/branches/builder/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java)
URL: http://svn.apache.org/viewvc/continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/DefaultContinuumScm.java?p2=continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/DefaultContinuumScm.java&p1=continuum/branches/builder/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java&r1=647661&r2=651947&rev=651947&view=diff
==============================================================================
--- continuum/branches/builder/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java (original)
+++ continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/DefaultContinuumScm.java Sun Apr 27 06:46:10 2008
@@ -1,4 +1,4 @@
-package org.apache.maven.continuum.scm;
+package org.apache.continuum.scm;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -19,333 +19,143 @@
  * under the License.
  */
 
-import org.apache.maven.continuum.core.action.AbstractContinuumAction;
-import org.apache.maven.continuum.model.project.BuildResult;
-import org.apache.maven.continuum.model.project.Project;
-import org.apache.maven.continuum.model.scm.ChangeFile;
-import org.apache.maven.continuum.model.scm.ChangeSet;
-import org.apache.maven.continuum.model.scm.ScmResult;
-import org.apache.maven.continuum.store.ContinuumStore;
-import org.apache.maven.continuum.utils.WorkingDirectoryService;
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang.StringUtils;
 import org.apache.maven.scm.ScmException;
-import org.apache.maven.scm.ScmFile;
 import org.apache.maven.scm.ScmFileSet;
+import org.apache.maven.scm.ScmTag;
+import org.apache.maven.scm.ScmVersion;
 import org.apache.maven.scm.command.checkout.CheckOutScmResult;
 import org.apache.maven.scm.command.update.UpdateScmResult;
 import org.apache.maven.scm.manager.NoSuchScmProviderException;
 import org.apache.maven.scm.manager.ScmManager;
 import org.apache.maven.scm.repository.ScmRepository;
 import org.apache.maven.scm.repository.ScmRepositoryException;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
-import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.util.StringUtils;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Date;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
- * @version $Id$
+ * @todo consider folding some of this into Maven SCM itself
  */
 public class DefaultContinuumScm
-    extends AbstractLogEnabled
     implements ContinuumScm
 {
-    /**
-     * @plexus.requirement
-     */
+    /** The Maven SCM manager to use. */
     private ScmManager scmManager;
 
-    /**
-     * @plexus.requirement
-     */
-    private WorkingDirectoryService workingDirectoryService;
-
-    /**
-     * @plexus.requirement role-hint="jdo"
-     */
-    private ContinuumStore store;
-
-    /**
-     * @plexus.configuration
-     */
-    private Properties updateProperties;
-
-    // ----------------------------------------------------------------------
-    // ContinuumScm implementation
-    // ----------------------------------------------------------------------
-
-    public ScmResult checkOut( Project project, File workingDirectory, Map context )
-        throws ContinuumScmException
+    public CheckOutScmResult checkout( ContinuumScmConfiguration configuration )
+        throws IOException, ScmException
     {
-        String tag = project.getScmTag();
+        ScmVersion scmVersion = getScmVersion( configuration );
 
-        String tagMessage = "";
+        // TODO: probably need to base this from a working directory in the main configuration
+        File workingDirectory = configuration.getWorkingDirectory();
 
-        if ( tag != null && !StringUtils.isEmpty( tag.trim() ) )
-        {
-            tagMessage = " with branch/tag " + tag;
+        ScmRepository repository = getScmRepository( configuration );
 
-            tag = tag.trim();
-        }
-        else
-        {
-            tag = null;
-        }
+        CheckOutScmResult result;
 
-        try
+        // TODO: synchronizing *all* checkouts is unnecessary
+        synchronized ( this )
         {
-            getLogger().info( "Checking out project: '" + project.getName() + "', " + "id: '" + project.getId() + "' " +
-                "to '" + workingDirectory + "'" + tagMessage + "." );
-
-            ScmRepository repository = getScmRepository( project, project.isScmUseCache() );
-
-            ScmResult result;
-
-            synchronized ( this )
+            if ( !workingDirectory.exists() )
             {
-                if ( !workingDirectory.exists() )
-                {
-                    if ( !workingDirectory.mkdirs() )
-                    {
-                        throw new ContinuumScmException(
-                            "Could not make directory: " + workingDirectory.getAbsolutePath() );
-                    }
-                }
-                else
-                {
-                    try
-                    {
-                        FileUtils.cleanDirectory( workingDirectory );
-                    }
-                    catch ( IOException e )
-                    {
-                        throw new ContinuumScmException(
-                            "Could not clean directory : " + workingDirectory.getAbsolutePath(), e );
-                    }
-                }
-
-                ScmFileSet fileSet = new ScmFileSet( workingDirectory );
-
-                CheckOutScmResult res =
-                    scmManager.getProviderByRepository( repository ).checkOut( repository, fileSet, tag );
-
-                if ( StringUtils.isNotEmpty( res.getRelativePathProjectDirectory() ) )
+                if ( !workingDirectory.mkdirs() )
                 {
-                    context.put( AbstractContinuumAction.KEY_PROJECT_RELATIVE_PATH,
-                                 res.getRelativePathProjectDirectory() );
+                    throw new IOException( "Could not make directory: " + workingDirectory.getAbsolutePath() );
                 }
-
-                result = convertScmResult( res );
-            }
-
-            if ( !result.isSuccess() )
-            {
-                getLogger().warn( "Error while checking out the code for project: '" + project.getName() + "', id: '" +
-                    project.getId() + "' to '" + workingDirectory.getAbsolutePath() + "'" + tagMessage + "." );
-
-                getLogger().warn( "Command output: " + result.getCommandOutput() );
-
-                getLogger().warn( "Provider message: " + result.getProviderMessage() );
             }
             else
             {
-                ChangeSet changeSet = (ChangeSet) result.getChanges().get( 0 );
-                getLogger().info( "Checked out " + changeSet.getFiles().size() + " files." );
+                FileUtils.cleanDirectory( workingDirectory );
             }
 
-            return result;
-        }
-        catch ( ScmRepositoryException e )
-        {
-            String message = getValidationMessages( e );
+            ScmFileSet fileSet = new ScmFileSet( workingDirectory );
 
-            throw new ContinuumScmException( "Cannot checkout sources." + message, e );
-        }
-        catch ( ScmException e )
-        {
-            throw new ContinuumScmException( "Cannot checkout sources.", e );
-        }
-        catch ( Exception e )
-        {
-            throw new ContinuumScmException( "Cannot checkout sources.", e );
+            result = scmManager.checkOut( repository, fileSet, scmVersion );
         }
+        return result;
     }
 
-    /**
-     * Checks out the sources to the specified directory.
-     *
-     * @param project The project to check out.
-     * @throws ContinuumScmException Thrown in case of a exception while checking out the sources.
-     */
-    public ScmResult checkOutProject( Project project, Map context )
-        throws ContinuumScmException
+    private ScmVersion getScmVersion( ContinuumScmConfiguration configuration )
     {
-        File workingDirectory = workingDirectoryService.getWorkingDirectory( project );
+        String tag = configuration.getTag();
 
-        if ( workingDirectory == null )
+        ScmVersion scmVersion = null;
+        if ( tag != null )
         {
-            throw new ContinuumScmException( "The working directory for the project has to be set. Project: '" +
-                project.getName() + "', id: '" + project.getId() + "'." );
+            // TODO: differentiate between tag and branch? Allow for revision?
+            scmVersion = new ScmTag( tag );
         }
-
-        return checkOut( project, workingDirectory, context );
+        return scmVersion;
     }
 
-    public ScmResult updateProject( Project project, Map context )
-        throws ContinuumScmException
+    public UpdateScmResult update( ContinuumScmConfiguration configuration )
+        throws ScmException
     {
-        String tag = project.getScmTag();
-
-        String tagMessage = "";
-
-        if ( tag != null && !StringUtils.isEmpty( tag.trim() ) )
-        {
-            tagMessage = " with branch/tag " + tag;
-
-            tag = tag.trim();
-        }
-        else
-        {
-            tag = null;
-        }
-
-        try
-        {
-            getLogger().info( "Updating project: id: '" + project.getId() + "', name '" + project.getName() + "'" +
-                tagMessage + "." );
-
-            File workingDirectory = workingDirectoryService.getWorkingDirectory( project );
-
-            if ( !workingDirectory.exists() )
-            {
-                throw new ContinuumScmException( "The working directory for the project doesn't exist " + "(" +
-                    workingDirectory.getAbsolutePath() + ")." );
-            }
-
-            //Some SCM provider requires additional system properties during update
-            if ( updateProperties != null )
-            {
-                Enumeration propertyKeys = updateProperties.propertyNames();
-
-                while ( propertyKeys.hasMoreElements() )
-                {
-                    String key = (String) propertyKeys.nextElement();
-
-                    System.setProperty( key, updateProperties.getProperty( key ) );
-                }
-            }
-
-            ScmRepository repository = getScmRepository( project, project.isScmUseCache() );
-
-            ScmResult result;
-
-            UpdateScmResult scmResult;
-
-            ScmFileSet fileSet = new ScmFileSet( workingDirectory );
-
-            synchronized ( this )
-            {
-                scmResult = scmManager.getProviderByRepository( repository )
-                    .update( repository, fileSet, tag, getLatestUpdateDate( project ) );
-                result = convertScmResult( scmResult );
-            }
-
-            if ( !result.isSuccess() )
-            {
-                getLogger().warn( "Error while updating the code for project: '" + project.getName() + "', id: '" +
-                    project.getId() + "' to '" + workingDirectory.getAbsolutePath() + "'" + tagMessage + "." );
-
-                getLogger().warn( "Command output: " + result.getCommandOutput() );
-
-                getLogger().warn( "Provider message: " + result.getProviderMessage() );
-            }
-
-            if ( scmResult.getUpdatedFiles() != null && scmResult.getUpdatedFiles().size() > 0 )
-            {
-                getLogger().info( "Updated " + scmResult.getUpdatedFiles().size() + " files." );
-            }
+        ScmVersion scmVersion = getScmVersion( configuration );
 
-            return result;
-        }
-        catch ( ScmRepositoryException e )
-        {
-            String message = getValidationMessages( e );
-
-            throw new ContinuumScmException( "Error while update sources." + message, e );
-        }
-        catch ( ScmException e )
-        {
-            throw new ContinuumScmException( "Error while update sources.", e );
-        }
-        catch ( Exception e )
+        File workingDirectory = configuration.getWorkingDirectory();
+        if ( !workingDirectory.exists() )
         {
-            throw new ContinuumScmException( "Cannot checkout sources.", e );
+            // TODO: maybe we could check it out - it seems we currently rely on Continuum figuring this out
+            throw new IllegalStateException( "The working directory for the project doesn't exist " + "("
+                + workingDirectory.getAbsolutePath() + ")." );
         }
-    }
-
-    private String getValidationMessages( ScmRepositoryException ex )
-    {
-        List messages = ex.getValidationMessages();
 
-        StringBuffer message = new StringBuffer();
+        ScmRepository repository = getScmRepository( configuration );
 
-        if ( messages != null && !messages.isEmpty() )
+        // Some SCM provider requires additional system properties during update
+        if ( "starteam".equals( repository.getProvider() ) )
         {
-            for ( Iterator i = messages.iterator(); i.hasNext(); )
-            {
-                message.append( (String) i.next() );
+            // TODO: remove the use of system property - need a better way to pass provider specific configuration
 
-                if ( i.hasNext() )
-                {
-                    message.append( System.getProperty( "line.separator" ) );
-                }
-            }
+            // Remove the clientspec name, so it will be recalculated between each command for each project
+            // instead of use the same for all projects
+            System.setProperty( "maven.scm.starteam.deleteLocal", "true" );
         }
-        return message.toString();
-    }
 
-    // ----------------------------------------------------------------------
-    //
-    // ----------------------------------------------------------------------
+        UpdateScmResult result;
 
-    private Date getLatestUpdateDate( Project project )
-    {
-        try
-        {
-            BuildResult result = store.getLatestBuildResultForProject( project.getId() );
+        ScmFileSet fileSet = new ScmFileSet( workingDirectory );
 
-            return new Date( result.getStartTime() );
-        }
-        catch ( Exception e )
+        // TODO: shouldn't need to synchronize this
+        synchronized ( this )
         {
+            result = scmManager.update( repository, fileSet, scmVersion, configuration.getLatestUpdateDate() );
         }
 
-        return null;
+        return result;
     }
 
-    private ScmRepository getScmRepository( Project project, boolean useCredentialsCache )
+    /**
+     * Create a Maven SCM repository for obtaining the checkout from.
+     * 
+     * @param scmUrl the SCM URL to obtain the checkout from
+     * @param useCredentialsCache whether to allow the use of cached credentials for SVN
+     * @return the repository created
+     */
+    private ScmRepository getScmRepository( ContinuumScmConfiguration configuration )
         throws ScmRepositoryException, NoSuchScmProviderException
     {
-        ScmRepository repository = scmManager.makeScmRepository( project.getScmUrl().trim() );
+        ScmRepository repository = scmManager.makeScmRepository( configuration.getUrl() );
 
+        // TODO: tie together with the clientspec change below
+        // This checkout will be retained between uses, so it remains connected to the repository
         repository.getProviderRepository().setPersistCheckout( true );
 
-        if ( !( useCredentialsCache && repository.getProvider().equals( "svn" ) ) )
+        // TODO: should this be svnexe?
+        if ( !configuration.isUseCredentialsCache() || !"svn".equals( repository.getProvider() ) )
         {
-            if ( !StringUtils.isEmpty( project.getScmUsername() ) )
+            if ( !StringUtils.isEmpty( configuration.getUsername() ) )
             {
-                repository.getProviderRepository().setUser( project.getScmUsername() );
+                repository.getProviderRepository().setUser( configuration.getUsername() );
 
-                if ( !StringUtils.isEmpty( project.getScmPassword() ) )
+                if ( !StringUtils.isEmpty( configuration.getPassword() ) )
                 {
-                    repository.getProviderRepository().setPassword( project.getScmPassword() );
+                    repository.getProviderRepository().setPassword( configuration.getPassword() );
                 }
                 else
                 {
@@ -354,150 +164,27 @@
             }
         }
 
-        if ( repository.getProvider().equals( "perforce" ) )
+        if ( "perforce".equals( repository.getProvider() ) )
         {
-            //Remove the clientspec name, so it will be recalcuated between each command for each project
-            //instead of use the same for all projects
+            // TODO: remove the use of system property - need a better way to pass provider specific configuration
+
+            // Remove the clientspec name, so it will be recalculated between each command for each project
+            // instead of use the same for all projects
             System.setProperty( "maven.scm.perforce.clientspec.name", "" );
         }
 
         return repository;
     }
 
-    private ScmResult convertScmResult( CheckOutScmResult scmResult )
-    {
-        ScmResult result = new ScmResult();
-
-        result.setSuccess( scmResult.isSuccess() );
-
-        result.setCommandLine( writeCommandLine( scmResult.getCommandLine() ) );
-
-        result.setCommandOutput( scmResult.getCommandOutput() );
-
-        result.setProviderMessage( scmResult.getProviderMessage() );
-
-        // TODO: is this valid? Does it ever return a changeset itself?
-        ChangeSet changeSet = convertScmFileSetToChangeSet( scmResult.getCheckedOutFiles() );
-        if ( changeSet != null )
-        {
-            result.addChange( changeSet );
-        }
-
-        return result;
-    }
-
-    private static ChangeSet convertScmFileSetToChangeSet( List files )
+    public ScmManager getScmManager()
     {
-        ChangeSet changeSet = null;
-
-        if ( files != null && !files.isEmpty() )
-        {
-            changeSet = new ChangeSet();
-
-            // TODO: author, etc.
-            for ( Iterator it = files.iterator(); it.hasNext(); )
-            {
-                ScmFile scmFile = (ScmFile) it.next();
-
-                ChangeFile file = new ChangeFile();
-
-                file.setName( scmFile.getPath() );
-
-                // TODO: revision?
-
-                file.setStatus( scmFile.getStatus().toString() );
-
-                changeSet.addFile( file );
-            }
-        }
-        return changeSet;
+        return scmManager;
     }
 
-    private ScmResult convertScmResult( UpdateScmResult scmResult )
+    public void setScmManager( ScmManager scmManager )
     {
-        ScmResult result = new ScmResult();
-
-        result.setCommandLine( writeCommandLine( scmResult.getCommandLine() ) );
-
-        result.setSuccess( scmResult.isSuccess() );
-
-        result.setCommandOutput( scmResult.getCommandOutput() );
-
-        result.setProviderMessage( scmResult.getProviderMessage() );
-
-        if ( scmResult.getChanges() != null && !scmResult.getChanges().isEmpty() )
-        {
-            for ( Iterator it = scmResult.getChanges().iterator(); it.hasNext(); )
-            {
-                org.apache.maven.scm.ChangeSet scmChangeSet = (org.apache.maven.scm.ChangeSet) it.next();
-
-                ChangeSet change = new ChangeSet();
-
-                change.setAuthor( scmChangeSet.getAuthor() );
-
-                change.setComment( scmChangeSet.getComment() );
-
-                if ( scmChangeSet.getDate() != null )
-                {
-                    change.setDate( scmChangeSet.getDate().getTime() );
-                }
-
-                if ( scmChangeSet.getFiles() != null )
-                {
-                    for ( Iterator i = scmChangeSet.getFiles().iterator(); i.hasNext(); )
-                    {
-                        org.apache.maven.scm.ChangeFile f = (org.apache.maven.scm.ChangeFile) i.next();
-
-                        ChangeFile file = new ChangeFile();
-
-                        file.setName( f.getName() );
-
-                        file.setRevision( f.getRevision() );
-
-                        change.addFile( file );
-                    }
-                }
-
-                result.addChange( change );
-            }
-        }
-        else
-        {
-            //We don't have a changes information probably because provider doesn't have a changelog command
-            //so we use the updated list that contains only the updated files list
-            ChangeSet changeSet = convertScmFileSetToChangeSet( scmResult.getUpdatedFiles() );
-
-            if ( changeSet != null )
-            {
-                result.addChange( changeSet );
-            }
-
-        }
-
-        return result;
+        this.scmManager = scmManager;
     }
 
-    /**
-     * Remove password from command line
-     */
-    private String writeCommandLine( String commandLine )
-    {
-        String cmd = commandLine;
-
-        if ( cmd != null && cmd.startsWith( "svn" ) )
-        {
-            String pwdString = "--password";
-
-            if ( cmd.indexOf( pwdString ) > 0 )
-            {
-                int index = cmd.indexOf( pwdString ) + pwdString.length() + 1;
-
-                int nextSpace = cmd.indexOf( " ", index );
-
-                cmd = cmd.substring( 0, index ) + "********" + cmd.substring( nextSpace );
-            }
-        }
-
-        return cmd;
-    }
+    // TODO: add a nuke() method
 }

Added: continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/manager/ScmManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/manager/ScmManager.java?rev=651947&view=auto
==============================================================================
--- continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/manager/ScmManager.java (added)
+++ continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/manager/ScmManager.java Sun Apr 27 06:46:10 2008
@@ -0,0 +1,54 @@
+package org.apache.continuum.scm.manager;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.Map;
+
+import org.apache.maven.scm.log.ScmLogger;
+import org.apache.maven.scm.manager.AbstractScmManager;
+import org.apache.maven.scm.provider.ScmProvider;
+
+/**
+ * Default implementation of the SCM manager.
+ * 
+ * @todo move to maven-scm as the default 
+ */
+public class ScmManager
+    extends AbstractScmManager
+{
+    private ScmLogger scmLogger;
+    
+    @Override
+    protected ScmLogger getScmLogger()
+    {
+        return scmLogger;
+    }
+
+    @Override
+    public void setScmProviders( Map providers )
+    {
+        super.setScmProviders( providers );
+    }
+
+    public void setScmLogger( ScmLogger scmLogger )
+    {
+        this.scmLogger = scmLogger;
+    }
+}

Propchange: continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/manager/ScmManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/manager/ScmManager.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/manager/Slf4jScmLogger.java
URL: http://svn.apache.org/viewvc/continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/manager/Slf4jScmLogger.java?rev=651947&view=auto
==============================================================================
--- continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/manager/Slf4jScmLogger.java (added)
+++ continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/manager/Slf4jScmLogger.java Sun Apr 27 06:46:10 2008
@@ -0,0 +1,114 @@
+package org.apache.continuum.scm.manager;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.scm.log.ScmLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * SLF4J logger for Maven SCM.
+ * @todo move to maven-scm? 
+ */
+public class Slf4jScmLogger
+    implements ScmLogger
+{
+    private Logger logger = LoggerFactory.getLogger( Slf4jScmLogger.class );
+
+    public void debug( String arg0 )
+    {
+        logger.debug( arg0 );
+    }
+
+    public void debug( Throwable arg0 )
+    {
+        logger.debug( "Exception", arg0 );
+    }
+
+    public void debug( String arg0, Throwable arg1 )
+    {
+        logger.debug( arg0, arg1 );
+    }
+
+    public void error( String arg0 )
+    {
+        logger.error( arg0 );
+    }
+
+    public void error( Throwable arg0 )
+    {
+        logger.error( "Exception", arg0 );
+    }
+
+    public void error( String arg0, Throwable arg1 )
+    {
+        logger.error( arg0, arg1 );
+    }
+
+    public void info( String arg0 )
+    {
+        logger.info( arg0 );
+    }
+
+    public void info( Throwable arg0 )
+    {
+        logger.info( "Exception", arg0 );
+    }
+
+    public void info( String arg0, Throwable arg1 )
+    {
+        logger.info( arg0, arg1 );
+    }
+
+    public boolean isDebugEnabled()
+    {
+        return logger.isDebugEnabled();
+    }
+
+    public boolean isErrorEnabled()
+    {
+        return logger.isErrorEnabled();
+    }
+
+    public boolean isInfoEnabled()
+    {
+        return logger.isInfoEnabled();
+    }
+
+    public boolean isWarnEnabled()
+    {
+        return logger.isWarnEnabled();
+    }
+
+    public void warn( String arg0 )
+    {
+        logger.warn( arg0 );
+    }
+
+    public void warn( Throwable arg0 )
+    {
+        logger.warn( "Exception", arg0 );
+    }
+
+    public void warn( String arg0, Throwable arg1 )
+    {
+        logger.warn( arg0, arg1 );
+    }
+}

Propchange: continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/manager/Slf4jScmLogger.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/branches/builder/continuum-base/continuum-scm/src/main/java/org/apache/continuum/scm/manager/Slf4jScmLogger.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: continuum/branches/builder/continuum-base/continuum-scm/src/main/resources/META-INF/spring-context.xml
URL: http://svn.apache.org/viewvc/continuum/branches/builder/continuum-base/continuum-scm/src/main/resources/META-INF/spring-context.xml?rev=651947&view=auto
==============================================================================
--- continuum/branches/builder/continuum-base/continuum-scm/src/main/resources/META-INF/spring-context.xml (added)
+++ continuum/branches/builder/continuum-base/continuum-scm/src/main/resources/META-INF/spring-context.xml Sun Apr 27 06:46:10 2008
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+  <bean id="continuumScm" class="org.apache.continuum.scm.DefaultContinuumScm">
+    <property name="scmManager" ref="scmManager" />
+  </bean>
+
+  <bean id="scmManager" class="org.apache.continuum.scm.manager.ScmManager">
+    <property name="scmLogger" ref="scmLogger" />
+  </bean>
+
+  <bean id="scmLogger" class="org.apache.continuum.scm.manager.Slf4jScmLogger" />
+</beans>

Propchange: continuum/branches/builder/continuum-base/continuum-scm/src/main/resources/META-INF/spring-context.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: continuum/branches/builder/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/manager/ScmManagerTest.java
URL: http://svn.apache.org/viewvc/continuum/branches/builder/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/manager/ScmManagerTest.java?rev=651947&view=auto
==============================================================================
--- continuum/branches/builder/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/manager/ScmManagerTest.java (added)
+++ continuum/branches/builder/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/manager/ScmManagerTest.java Sun Apr 27 06:46:10 2008
@@ -0,0 +1,52 @@
+package org.apache.continuum.scm.manager;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.scm.manager.NoSuchScmProviderException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+import junit.framework.TestCase;
+
+/**
+ * @todo replace with a spring integration test
+ */
+public class ScmManagerTest
+    extends TestCase
+{
+    private ApplicationContext context;
+
+    private ScmManager manager;
+
+    public void setUp()
+    {
+        context =
+            new ClassPathXmlApplicationContext( new String[] { "classpath*:META-INF/spring-context.xml",
+                "classpath*:" + getClass().getName().replace( '.', '/' ) + ".xml" } );
+        manager = (ScmManager) context.getBean( "scmManager" );
+    }
+
+    public void testScmProviders()
+        throws NoSuchScmProviderException
+    {
+        manager.getScmLogger().info( "Hello, World" );
+        assertNotNull( manager.getProviderByType( "svnexe" ) );
+    }
+}

Propchange: continuum/branches/builder/continuum-base/continuum-scm/src/test/java/org/apache/continuum/scm/manager/ScmManagerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: continuum/branches/builder/continuum-base/continuum-scm/src/test/resources/org/apache/continuum/scm/manager/ScmManagerTest.xml
URL: http://svn.apache.org/viewvc/continuum/branches/builder/continuum-base/continuum-scm/src/test/resources/org/apache/continuum/scm/manager/ScmManagerTest.xml?rev=651947&view=auto
==============================================================================
--- continuum/branches/builder/continuum-base/continuum-scm/src/test/resources/org/apache/continuum/scm/manager/ScmManagerTest.xml (added)
+++ continuum/branches/builder/continuum-base/continuum-scm/src/test/resources/org/apache/continuum/scm/manager/ScmManagerTest.xml Sun Apr 27 06:46:10 2008
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://www.springframework.org/schema/beans
+           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+  <bean id="scmManager"
+    class="org.apache.continuum.scm.manager.ScmManager">
+    <!--  TODO: better way to add the providers without having to redeclare all this? -->
+    <property name="scmLogger" ref="scmLogger" />
+    <property name="scmProviders">
+      <map>
+        <entry key="svnexe">
+          <bean
+            class="org.apache.maven.scm.provider.svn.svnexe.SvnExeScmProvider" />
+        </entry>
+      </map>
+    </property>
+  </bean>
+</beans>
+
+

Propchange: continuum/branches/builder/continuum-base/continuum-scm/src/test/resources/org/apache/continuum/scm/manager/ScmManagerTest.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: continuum/branches/builder/continuum-base/continuum-scm/src/test/resources/org/apache/continuum/scm/manager/ScmManagerTest.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: continuum/branches/builder/continuum-base/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/builder/continuum-base/pom.xml?rev=651947&view=auto
==============================================================================
--- continuum/branches/builder/continuum-base/pom.xml (added)
+++ continuum/branches/builder/continuum-base/pom.xml Sun Apr 27 06:46:10 2008
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <artifactId>continuum</artifactId>
+    <groupId>org.apache.continuum</groupId>
+    <version>1.2-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>continuum-base</artifactId>
+  <name>Continuum :: Base</name>
+  <packaging>pom</packaging>
+  <modules>
+    <module>continuum-scm</module>
+  </modules>
+</project>

Propchange: continuum/branches/builder/continuum-base/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: continuum/branches/builder/continuum-core/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/builder/continuum-core/pom.xml?rev=651947&r1=651946&r2=651947&view=diff
==============================================================================
--- continuum/branches/builder/continuum-core/pom.xml (original)
+++ continuum/branches/builder/continuum-core/pom.xml Sun Apr 27 06:46:10 2008
@@ -128,6 +128,10 @@
       <artifactId>continuum-security</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.apache.continuum</groupId>
+      <artifactId>continuum-scm</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.codehaus.plexus.redback</groupId>
       <artifactId>redback-rbac-role-manager</artifactId>
     </dependency>

Modified: continuum/branches/builder/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
URL: http://svn.apache.org/viewvc/continuum/branches/builder/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java?rev=651947&r1=651946&r2=651947&view=diff
==============================================================================
--- continuum/branches/builder/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java (original)
+++ continuum/branches/builder/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java Sun Apr 27 06:46:10 2008
@@ -29,12 +29,13 @@
 import org.apache.maven.continuum.model.scm.ScmResult;
 import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
 import org.apache.maven.continuum.project.ContinuumProjectState;
-import org.apache.maven.continuum.scm.ContinuumScmException;
 import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
 import org.apache.maven.continuum.store.ContinuumStore;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.apache.maven.continuum.utils.ContinuumUtils;
 import org.apache.maven.continuum.utils.WorkingDirectoryService;
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.repository.ScmRepositoryException;
 import org.codehaus.plexus.action.ActionManager;
 import org.codehaus.plexus.action.ActionNotFoundException;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
@@ -413,19 +414,15 @@
             error = ContinuumUtils.throwableToString( e );
             exception = new TaskExecutionException( "Error looking up action '" + actionName + "'", e );
         }
-        catch ( ContinuumScmException e )
+        catch ( ScmRepositoryException e )
         {
-            ScmResult result = e.getResult();
+            error = getValidationMessages( e ) + "\n" + ContinuumUtils.throwableToString( e );
 
-            if ( result != null )
-            {
-                error = convertScmResultToError( result );
-            }
-
-            if ( error == null )
-            {
-                error = ContinuumUtils.throwableToString( e );
-            }
+            exception = new TaskExecutionException( "SCM error while executing '" + actionName + "'", e );
+        }
+        catch ( ScmException e )
+        {
+            error = ContinuumUtils.throwableToString( e );
 
             exception = new TaskExecutionException( "SCM error while executing '" + actionName + "'", e );
         }
@@ -569,6 +566,27 @@
         }
 
         return true;
+    }
+
+    private String getValidationMessages( ScmRepositoryException ex )
+    {
+        List<String> messages = ex.getValidationMessages();
+
+        StringBuffer message = new StringBuffer();
+
+        if ( messages != null && !messages.isEmpty() )
+        {
+            for ( Iterator<String> i = messages.iterator(); i.hasNext(); )
+            {
+                message.append( (String) i.next() );
+
+                if ( i.hasNext() )
+                {
+                    message.append( System.getProperty( "line.separator" ) );
+                }
+            }
+        }
+        return message.toString();
     }
 
     protected void checkProjectDependencies( BuildContext context )

Modified: continuum/branches/builder/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/builder/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java?rev=651947&r1=651946&r2=651947&view=diff
==============================================================================
--- continuum/branches/builder/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java (original)
+++ continuum/branches/builder/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java Sun Apr 27 06:46:10 2008
@@ -19,27 +19,32 @@
  * under the License.
  */
 
-import org.apache.maven.continuum.Continuum;
+import java.io.File;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.continuum.scm.ContinuumScm;
+import org.apache.continuum.scm.ContinuumScmConfiguration;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.scm.ScmResult;
 import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
 import org.apache.maven.continuum.project.ContinuumProjectState;
-import org.apache.maven.continuum.scm.ContinuumScm;
-import org.apache.maven.continuum.scm.ContinuumScmException;
+import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
 import org.apache.maven.continuum.store.ContinuumStore;
+import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.apache.maven.continuum.utils.ContinuumUtils;
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.command.checkout.CheckOutScmResult;
 import org.apache.maven.scm.manager.NoSuchScmProviderException;
+import org.apache.maven.scm.repository.ScmRepositoryException;
 import org.codehaus.plexus.util.StringUtils;
 
-import java.io.File;
-import java.util.Map;
-
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
- * @plexus.component role="org.codehaus.plexus.action.Action"
- * role-hint="checkout-project"
+ * @plexus.component role="org.codehaus.plexus.action.Action" role-hint="checkout-project"
  */
 public class CheckoutProjectContinuumAction
     extends AbstractContinuumAction
@@ -60,7 +65,7 @@
     private ContinuumStore store;
 
     public void execute( Map context )
-        throws Exception
+        throws ContinuumObjectNotFoundException, ContinuumStoreException
     {
         Project project = store.getProject( getProject( context ).getId() );
 
@@ -85,39 +90,71 @@
 
         try
         {
-            result = scm.checkOut( project, workingDirectory, context );
-            //CONTINUUM-1394
-            result.setChanges( null );
-        }
-        catch ( ContinuumScmException e )
-        {
-            // TODO: Dissect the scm exception to be able to give better feedback
-            Throwable cause = e.getCause();
+            ContinuumScmConfiguration config = createScmConfiguration( project, workingDirectory );
 
-            if ( cause instanceof NoSuchScmProviderException )
-            {
-                result = new ScmResult();
-
-                result.setSuccess( false );
+            String tag = config.getTag();
+            getLogger().info(
+                              "Checking out project: '" + project.getName() + "', id: '" + project.getId() + "' "
+                                  + "to '" + workingDirectory + "'"
+                                  + ( tag != null ? " with branch/tag " + tag + "." : "." ) );
 
-                result.setProviderMessage( cause.getMessage() );
+            CheckOutScmResult checkoutResult = scm.checkout( config );
+            if ( StringUtils.isNotEmpty( checkoutResult.getRelativePathProjectDirectory() ) )
+            {
+                context.put( AbstractContinuumAction.KEY_PROJECT_RELATIVE_PATH,
+                             checkoutResult.getRelativePathProjectDirectory() );
             }
-            else if ( e.getResult() != null )
+
+            if ( !checkoutResult.isSuccess() )
             {
-                result = e.getResult();
+                // TODO: is it more appropriate to return this in the converted result so that it can be presented to
+                // the user?
+                String msg =
+                    "Error while checking out the code for project: '" + project.getName() + "', id: '"
+                        + project.getId() + "' to '" + workingDirectory.getAbsolutePath() + "'"
+                        + ( tag != null ? " with branch/tag " + tag + "." : "." );
+                getLogger().warn( msg );
+
+                getLogger().warn( "Command output: " + checkoutResult.getCommandOutput() );
+
+                getLogger().warn( "Provider message: " + checkoutResult.getProviderMessage() );
             }
             else
             {
-                result = new ScmResult();
+                getLogger().info( "Checked out " + checkoutResult.getCheckedOutFiles().size() + " files." );
+            }
+
+            result = convertScmResult( checkoutResult );
+        }
+        catch ( ScmRepositoryException e )
+        {
+            result = new ScmResult();
 
-                result.setSuccess( false );
+            result.setSuccess( false );
 
-                result.setException( ContinuumUtils.throwableMessagesToString( e ) );
-            }
+            result.setProviderMessage( e.getMessage() + ": " + getValidationMessages( e ) );
+        }
+        catch ( NoSuchScmProviderException e )
+        {
+            // TODO: this is not making it back into a result of any kind - log it at least. Same is probably the case for ScmException
+            result = new ScmResult();
+
+            result.setSuccess( false );
+
+            result.setProviderMessage( e.getMessage() );
+        }
+        catch ( ScmException e )
+        {
+            result = new ScmResult();
+
+            result.setSuccess( false );
+
+            result.setException( ContinuumUtils.throwableMessagesToString( e ) );
         }
         catch ( Throwable t )
         {
             // TODO: do we want this here, or should it be to the logs?
+            // TODO: what throwables do we really get here that we can cope with?
             result = new ScmResult();
 
             result.setSuccess( false );
@@ -129,9 +166,7 @@
             String relativePath = (String) getObject( context, KEY_PROJECT_RELATIVE_PATH, "" );
             if ( StringUtils.isNotEmpty( relativePath ) )
             {
-
                 project.setRelativePath( relativePath );
-
             }
 
             project = store.getProject( project.getId() );
@@ -144,5 +179,74 @@
         }
 
         context.put( KEY_CHECKOUT_SCM_RESULT, result );
+    }
+
+    private ContinuumScmConfiguration createScmConfiguration( Project project, File workingDirectory )
+    {
+        ContinuumScmConfiguration config = new ContinuumScmConfiguration();
+        config.setUrl( project.getScmUrl() );
+        config.setUsername( project.getScmUsername() );
+        config.setPassword( project.getScmPassword() );
+        config.setUseCredentialsCache( project.isScmUseCache() );
+        config.setWorkingDirectory( workingDirectory );
+        config.setTag( project.getScmTag() );
+        return config;
+    }
+
+    private ScmResult convertScmResult( CheckOutScmResult scmResult )
+    {
+        ScmResult result = new ScmResult();
+
+        result.setSuccess( scmResult.isSuccess() );
+
+        result.setCommandLine( maskPassword( scmResult.getCommandLine() ) );
+
+        result.setCommandOutput( scmResult.getCommandOutput() );
+
+        result.setProviderMessage( scmResult.getProviderMessage() );
+
+        return result;
+    }
+
+    private String maskPassword( String commandLine )
+    {
+        String cmd = commandLine;
+
+        if ( cmd != null && cmd.startsWith( "svn" ) )
+        {
+            String pwdString = "--password";
+
+            if ( cmd.indexOf( pwdString ) > 0 )
+            {
+                int index = cmd.indexOf( pwdString ) + pwdString.length() + 1;
+
+                int nextSpace = cmd.indexOf( " ", index );
+
+                cmd = cmd.substring( 0, index ) + "********" + cmd.substring( nextSpace );
+            }
+        }
+
+        return cmd;
+    }
+
+    private String getValidationMessages( ScmRepositoryException ex )
+    {
+        List<String> messages = ex.getValidationMessages();
+
+        StringBuffer message = new StringBuffer();
+
+        if ( messages != null && !messages.isEmpty() )
+        {
+            for ( Iterator<String> i = messages.iterator(); i.hasNext(); )
+            {
+                message.append( (String) i.next() );
+
+                if ( i.hasNext() )
+                {
+                    message.append( System.getProperty( "line.separator" ) );
+                }
+            }
+        }
+        return message.toString();
     }
 }

Modified: continuum/branches/builder/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateWorkingDirectoryFromScmContinuumAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/builder/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateWorkingDirectoryFromScmContinuumAction.java?rev=651947&r1=651946&r2=651947&view=diff
==============================================================================
--- continuum/branches/builder/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateWorkingDirectoryFromScmContinuumAction.java (original)
+++ continuum/branches/builder/continuum-core/src/main/java/org/apache/maven/continuum/core/action/UpdateWorkingDirectoryFromScmContinuumAction.java Sun Apr 27 06:46:10 2008
@@ -19,21 +19,36 @@
  * under the License.
  */
 
+import org.apache.continuum.scm.ContinuumScm;
+import org.apache.continuum.scm.ContinuumScmConfiguration;
 import org.apache.maven.continuum.model.project.BuildDefinition;
+import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.model.scm.ChangeFile;
+import org.apache.maven.continuum.model.scm.ChangeSet;
 import org.apache.maven.continuum.model.scm.ScmResult;
 import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
 import org.apache.maven.continuum.project.ContinuumProjectState;
-import org.apache.maven.continuum.scm.ContinuumScm;
+import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
 import org.apache.maven.continuum.store.ContinuumStore;
-
+import org.apache.maven.continuum.store.ContinuumStoreException;
+import org.apache.maven.continuum.utils.WorkingDirectoryService;
+import org.apache.maven.scm.ScmException;
+import org.apache.maven.scm.ScmFile;
+import org.apache.maven.scm.command.update.UpdateScmResult;
+import org.apache.maven.scm.manager.NoSuchScmProviderException;
+import org.apache.maven.scm.repository.ScmRepositoryException;
+
+import java.io.File;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
- * @plexus.component role="org.codehaus.plexus.action.Action"
- * role-hint="update-working-directory-from-scm"
+ * @plexus.component role="org.codehaus.plexus.action.Action" role-hint="update-working-directory-from-scm"
  */
 public class UpdateWorkingDirectoryFromScmContinuumAction
     extends AbstractContinuumAction
@@ -49,12 +64,18 @@
     private ContinuumScm scm;
 
     /**
+     * @plexus.requirement
+     */
+    private WorkingDirectoryService workingDirectoryService;
+
+    /**
      * @plexus.requirement role-hint="jdo"
      */
     private ContinuumStore store;
 
     public void execute( Map context )
-        throws Exception
+        throws ScmRepositoryException, NoSuchScmProviderException, ScmException, ContinuumObjectNotFoundException,
+        ContinuumStoreException
     {
         Project project = store.getProject( getProject( context ).getId() );
 
@@ -66,25 +87,187 @@
 
         store.updateProject( project );
 
-        ScmResult scmResult;
+        UpdateScmResult scmResult;
+
+        Date latestUpdateDate = null;
+        try
+        {
+            BuildResult result = store.getLatestBuildResultForProject( project.getId() );
+
+            latestUpdateDate = new Date( result.getStartTime() );
+        }
+        catch ( Exception e )
+        {
+        }
 
         try
         {
             notifier.checkoutStarted( project, buildDefinition );
 
-            scmResult = scm.updateProject( project, context );
+            // TODO: not sure why this is different to the context, but it all needs to change
+            File workingDirectory = workingDirectoryService.getWorkingDirectory( project );
+            ContinuumScmConfiguration config = createScmConfiguration( project, workingDirectory );
+            config.setLatestUpdateDate( latestUpdateDate );
+            String tag = config.getTag();
+            String msg =
+                project.getName() + "', id: '" + project.getId() + "' to '" + workingDirectory.getAbsolutePath() + "'"
+                    + ( tag != null ? " with branch/tag " + tag + "." : "." );
+            getLogger().info( "Updating project: " + msg );
+            scmResult = scm.update( config );
+
+            if ( !scmResult.isSuccess() )
+            {
+                getLogger().warn( "Error while updating the code for project: '" + msg );
+
+                getLogger().warn( "Command output: " + scmResult.getCommandOutput() );
+
+                getLogger().warn( "Provider message: " + scmResult.getProviderMessage() );
+            }
+
+            if ( scmResult.getUpdatedFiles() != null && scmResult.getUpdatedFiles().size() > 0 )
+            {
+                getLogger().info( "Updated " + scmResult.getUpdatedFiles().size() + " files." );
+            }
 
-            context.put( KEY_UPDATE_SCM_RESULT, scmResult );
+            context.put( KEY_UPDATE_SCM_RESULT, convertScmResult( scmResult ) );
         }
         finally
         {
-            project = store.getProject( project.getId() );
+            // set back to the original state
+            // TODO: transient states!
+            try
+            {
+                project = store.getProject( project.getId() );
+
+                project.setState( state );
+
+                store.updateProject( project );
+            }
+            catch ( Exception e )
+            {
+                // nasty nasty, but we're in finally, so just sacrifice the state to keep the original exception
+                getLogger().error( e.getMessage(), e );
+            }
 
-            project.setState( state );
+            notifier.checkoutComplete( project, buildDefinition );
+        }
+    }
 
-            store.updateProject( project );
+    private ContinuumScmConfiguration createScmConfiguration( Project project, File workingDirectory )
+    {
+        ContinuumScmConfiguration config = new ContinuumScmConfiguration();
+        config.setUrl( project.getScmUrl() );
+        config.setUsername( project.getScmUsername() );
+        config.setPassword( project.getScmPassword() );
+        config.setUseCredentialsCache( project.isScmUseCache() );
+        config.setWorkingDirectory( workingDirectory );
+        config.setTag( project.getScmTag() );
+        return config;
+    }
+
+    private ScmResult convertScmResult( UpdateScmResult scmResult )
+    {
+        ScmResult result = new ScmResult();
+
+        result.setCommandLine( maskPassword( scmResult.getCommandLine() ) );
+
+        result.setSuccess( scmResult.isSuccess() );
+
+        result.setCommandOutput( scmResult.getCommandOutput() );
+
+        result.setProviderMessage( scmResult.getProviderMessage() );
+
+        if ( scmResult.getChanges() != null && !scmResult.getChanges().isEmpty() )
+        {
+            for ( org.apache.maven.scm.ChangeSet scmChangeSet : (List<org.apache.maven.scm.ChangeSet>) scmResult.getChanges() )
+            {
+                ChangeSet change = new ChangeSet();
+
+                change.setAuthor( scmChangeSet.getAuthor() );
+
+                change.setComment( scmChangeSet.getComment() );
+
+                if ( scmChangeSet.getDate() != null )
+                {
+                    change.setDate( scmChangeSet.getDate().getTime() );
+                }
+
+                if ( scmChangeSet.getFiles() != null )
+                {
+                    for ( org.apache.maven.scm.ChangeFile f : (List<org.apache.maven.scm.ChangeFile>) scmChangeSet.getFiles() )
+                    {
+                        ChangeFile file = new ChangeFile();
+
+                        file.setName( f.getName() );
+
+                        file.setRevision( f.getRevision() );
+
+                        change.addFile( file );
+                    }
+                }
+
+                result.addChange( change );
+            }
+        }
+        else
+        {
+            // We don't have a changes information probably because provider doesn't have a changelog command
+            // so we use the updated list that contains only the updated files list
+            ChangeSet changeSet = convertScmFileSetToChangeSet( scmResult.getUpdatedFiles() );
+
+            if ( changeSet != null )
+            {
+                result.addChange( changeSet );
+            }
 
-            notifier.checkoutComplete( project, buildDefinition );
         }
+
+        return result;
+    }
+
+    private static ChangeSet convertScmFileSetToChangeSet( List<ScmFile> files )
+    {
+        ChangeSet changeSet = null;
+
+        if ( files != null && !files.isEmpty() )
+        {
+            changeSet = new ChangeSet();
+
+            // TODO: author, etc.
+            for ( ScmFile scmFile : files )
+            {
+                ChangeFile file = new ChangeFile();
+
+                file.setName( scmFile.getPath() );
+
+                // TODO: revision?
+
+                file.setStatus( scmFile.getStatus().toString() );
+
+                changeSet.addFile( file );
+            }
+        }
+        return changeSet;
+    }
+
+    private String maskPassword( String commandLine )
+    {
+        String cmd = commandLine;
+
+        if ( cmd != null && cmd.startsWith( "svn" ) )
+        {
+            String pwdString = "--password";
+
+            if ( cmd.indexOf( pwdString ) > 0 )
+            {
+                int index = cmd.indexOf( pwdString ) + pwdString.length() + 1;
+
+                int nextSpace = cmd.indexOf( " ", index );
+
+                cmd = cmd.substring( 0, index ) + "********" + cmd.substring( nextSpace );
+            }
+        }
+
+        return cmd;
     }
 }

Modified: continuum/branches/builder/continuum-core/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/continuum/branches/builder/continuum-core/src/main/resources/META-INF/plexus/components.xml?rev=651947&r1=651946&r2=651947&view=diff
==============================================================================
--- continuum/branches/builder/continuum-core/src/main/resources/META-INF/plexus/components.xml (original)
+++ continuum/branches/builder/continuum-core/src/main/resources/META-INF/plexus/components.xml Sun Apr 27 06:46:10 2008
@@ -20,32 +20,6 @@
 <component-set>
   <components>
 
-    <!-- not using plexus-maven-plugin because of configuration complexity -->
-    <component>
-      <role>org.apache.maven.continuum.scm.ContinuumScm</role>
-      <implementation>org.apache.maven.continuum.scm.DefaultContinuumScm</implementation>
-      <requirements>
-        <requirement>
-          <role>org.apache.maven.scm.manager.ScmManager</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.continuum.utils.WorkingDirectoryService</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.continuum.store.ContinuumStore</role>
-          <role-hint>jdo</role-hint>
-        </requirement>
-      </requirements>
-      <configuration>
-        <updateProperties>
-          <property>
-            <name>maven.scm.starteam.deleteLocal</name>
-            <value>true</value>
-          </property>
-        </updateProperties>
-      </configuration>
-    </component>
-
     <!-- ConnectionConsumer -->
     <component>
       <role>org.apache.maven.continuum.network.ConnectionConsumer</role>

Modified: continuum/branches/builder/continuum-webapp/src/main/webapp/WEB-INF/applicationContext.xml
URL: http://svn.apache.org/viewvc/continuum/branches/builder/continuum-webapp/src/main/webapp/WEB-INF/applicationContext.xml?rev=651947&r1=651946&r2=651947&view=diff
==============================================================================
--- continuum/branches/builder/continuum-webapp/src/main/webapp/WEB-INF/applicationContext.xml (original)
+++ continuum/branches/builder/continuum-webapp/src/main/webapp/WEB-INF/applicationContext.xml Sun Apr 27 06:46:10 2008
@@ -24,5 +24,54 @@
     </property> 
   </bean>
   
+  <bean id="scmManager"
+    class="org.apache.continuum.scm.manager.ScmManager">
+    <!--  TODO: better way to add the providers without having to redeclare all this? -->
+    <property name="scmLogger" ref="scmLogger" />
+    <property name="scmProviders">
+      <map>
+        <entry key="svn">
+          <bean
+            class="org.apache.maven.scm.provider.svn.svnexe.SvnExeScmProvider" />
+        </entry>
+        <entry key="bazaar">
+          <bean
+            class="org.apache.maven.scm.provider.bazaar.BazaarScmProvider" />
+        </entry>
+        <entry key="clearcase">
+          <bean
+            class="org.apache.maven.scm.provider.clearcase.ClearCaseScmProvider" />
+        </entry>
+        <entry key="cvs">
+          <bean
+            class="org.apache.maven.scm.provider.cvslib.cvsjava.CvsJavaScmProvider" />
+        </entry>
+        <entry key="cvs_native">
+          <bean
+            class="org.apache.maven.scm.provider.cvslib.cvsexe.CvsExeScmProvider" />
+        </entry>
+        <entry key="local">
+          <bean
+            class="org.apache.maven.scm.provider.local.LocalScmProvider" />
+        </entry>
+        <entry key="perforce">
+          <bean
+            class="org.apache.maven.scm.provider.perforce.PerforceScmProvider" />
+        </entry>
+        <entry key="starteam">
+          <bean
+            class="org.apache.maven.scm.provider.starteam.StarteamScmProvider" />
+        </entry>
+        <entry key="synergy">
+          <bean
+            class="org.apache.maven.scm.provider.synergy.SynergyScmProvider" />
+        </entry>
+        <entry key="vss">
+          <bean
+            class="org.apache.maven.scm.provider.vss.VssScmProvider" />
+        </entry>
+      </map>
+    </property>
+  </bean>
   
 </beans>

Modified: continuum/branches/builder/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/builder/pom.xml?rev=651947&r1=651946&r2=651947&view=diff
==============================================================================
--- continuum/branches/builder/pom.xml (original)
+++ continuum/branches/builder/pom.xml Sun Apr 27 06:46:10 2008
@@ -16,8 +16,7 @@
   ~ KIND, either express or implied.  See the License for the
   ~ specific language governing permissions and limitations
   ~ under the License.
-  -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  --><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>org.apache.continuum</groupId>
@@ -171,6 +170,7 @@
     <module>maven-continuum-plugin</module>
     <module>continuum-docs</module>
     <module>continuum-jetty</module>
+    <module>continuum-base</module>
   </modules>
   <repositories>
     <repository>
@@ -236,6 +236,7 @@
       <version>3.8.1</version>
       <scope>test</scope>
     </dependency>
+    <!-- TODO: remove the below, they should not be universal -->
     <dependency>
       <groupId>jmock</groupId>
       <artifactId>jmock</artifactId>
@@ -408,6 +409,11 @@
       </dependency>
       <dependency>
         <groupId>org.apache.continuum</groupId>
+        <artifactId>continuum-scm</artifactId>
+        <version>${pom.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.continuum</groupId>
         <artifactId>continuum-store</artifactId>
         <classifier>tests</classifier>
         <version>${pom.version}</version>
@@ -851,5 +857,6 @@
     <maven-scm.version>1.1-SNAPSHOT</maven-scm.version>
     <redback.version>1.0-alpha-4</redback.version>
     <mail-sender.version>1.0-alpha-7</mail-sender.version>
+    <spring.version>2.5.1</spring.version>
   </properties>
 </project>