continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tryg...@apache.org
Subject svn commit: r209441 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ continuum-core/src/main/java/org/apache/maven/continuum/core/action/ continuum-core/src/main/java/org/apache/maven/continuum/execut...
Date Wed, 06 Jul 2005 10:25:01 GMT
Author: trygvis
Date: Wed Jul  6 03:24:57 2005
New Revision: 209441

URL: http://svn.apache.org/viewcvs?rev=209441&view=rev
Log:
o Adding warnings to the ContinuumProjectBuildingResult to be able to collect
  warnings from the building process.
o Removing all throwing of exceptions in the Maven 2 project builder and
  instead collect them as error messages.

Modified:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilder.java
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.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/CheckoutProjectContinuumAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/AbstractContinuumStore.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/ShellCommandHelper.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java
    maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/pom.xml

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilder.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilder.java?rev=209441&r1=209440&r2=209441&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilder.java
(original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilder.java
Wed Jul  6 03:24:57 2005
@@ -27,38 +27,31 @@
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
- * @version $Id:$
+ * @version $Id$
  */
 public abstract class AbstractContinuumProjectBuilder
     extends AbstractLogEnabled
     implements ContinuumProjectBuilder
 {
     protected File createMetadataFile( URL metadata )
-        throws ContinuumProjectBuilderException
+        throws IOException
     {
-        try
-        {
-            getLogger().info( "Downloading " + metadata.toExternalForm() );
+        getLogger().info( "Downloading " + metadata.toExternalForm() );
 
-            InputStream is = metadata.openStream();
+        InputStream is = metadata.openStream();
 
-            File file = File.createTempFile( "continuum-", ".tmp" );
+        File file = File.createTempFile( "continuum-", ".tmp" );
 
-            file.deleteOnExit();
+        file.deleteOnExit();
 
-            FileWriter writer = new FileWriter( file );
+        FileWriter writer = new FileWriter( file );
 
-            IOUtil.copy( is, writer );
+        IOUtil.copy( is, writer );
 
-            is.close();
+        is.close();
 
-            writer.close();
+        writer.close();
 
-            return file;
-        }
-        catch ( IOException e )
-        {
-            throw new ContinuumProjectBuilderException( "Error while downloading metadata.",
e );
-        }
+        return file;
     }
 }

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java?rev=209441&r1=209440&r2=209441&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java
(original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/project/builder/ContinuumProjectBuildingResult.java
Wed Jul  6 03:24:57 2005
@@ -23,16 +23,13 @@
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
- * @version $Id:$
+ * @version $Id$
  */
 public class ContinuumProjectBuildingResult
 {
-    private List projects;
+    private List projects = new ArrayList();
 
-    public ContinuumProjectBuildingResult()
-    {
-        projects = new ArrayList();
-    }
+    private List warnings = new ArrayList();
 
     public void addProject( ContinuumProject project )
     {
@@ -49,5 +46,15 @@
     public List getProjects()
     {
         return projects;
+    }
+
+    public void addWarning( String warning )
+    {
+        warnings.add( warning );
+    }
+
+    public List getWarnings()
+    {
+        return warnings;
     }
 }

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=209441&r1=209440&r2=209441&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
Wed Jul  6 03:24:57 2005
@@ -226,13 +226,13 @@
 
         if ( value == null )
         {
-            System.err.println( "context" );
-            for ( Iterator it = context.keySet().iterator(); it.hasNext(); )
-            {
-                String s = (String) it.next();
-
-                System.err.println( s );
-            }
+//            System.err.println( "context" );
+//            for ( Iterator it = context.keySet().iterator(); it.hasNext(); )
+//            {
+//                String s = (String) it.next();
+//
+//                System.err.println( s );
+//            }
 
             throw new RuntimeException( "Missing value for key '" + key + "'." );
         }

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=209441&r1=209440&r2=209441&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
Wed Jul  6 03:24:57 2005
@@ -23,6 +23,7 @@
 import org.apache.maven.continuum.scm.CheckOutScmResult;
 import org.apache.maven.continuum.scm.ContinuumScmException;
 import org.apache.maven.continuum.store.AbstractContinuumStore;
+import org.apache.maven.continuum.utils.ContinuumUtils;
 import org.apache.maven.scm.manager.NoSuchScmProviderException;
 
 /**
@@ -80,6 +81,6 @@
 
         context.put( KEY_CHECKOUT_ERROR_MESSAGE, errorMessage );
 
-        context.put( KEY_CHECKOUT_ERROR_EXCEPTION, AbstractContinuumStore.throwableToString(
exception ) );
+        context.put( KEY_CHECKOUT_ERROR_EXCEPTION, ContinuumUtils.throwableToString( exception
) );
     }
 }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java?rev=209441&r1=209440&r2=209441&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
Wed Jul  6 03:24:57 2005
@@ -41,13 +41,19 @@
     //
     // ----------------------------------------------------------------------
 
-    /** @plexus.requirement */
+    /**
+     * @plexus.requirement
+     */
     private ShellCommandHelper shellCommandHelper;
 
-    /** @plexus.requirement */
+    /**
+     * @plexus.requirement
+     */
     private ExecutableResolver executableResolver;
 
-    /** @plexus.configuration */
+    /**
+     * @plexus.configuration
+     */
     private String defaultExecutable;
 
     // ----------------------------------------------------------------------
@@ -58,8 +64,6 @@
 
     private boolean resolveExecutable;
 
-    private File resolvedExecutable;
-
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
@@ -89,16 +93,17 @@
             }
             else
             {
-                resolvedExecutable = executableResolver.findExecutable( defaultExecutable,
path );
+                File resolvedExecutable = executableResolver.findExecutable( defaultExecutable,
path );
 
                 if ( resolvedExecutable == null )
                 {
-                    getLogger().warn( "Could not find the executable '" + defaultExecutable
+ "' in the path '" + path + "'" );
+                    getLogger().warn( "Could not find the executable '" + defaultExecutable
+ "' in the " +
+                                      "path '" + path + "'." );
                 }
                 else
                 {
                     getLogger().info( "Resolved the executable '" + defaultExecutable + "'
to " +
-                                      "'" + resolvedExecutable.getAbsolutePath() + "'");
+                                      "'" + resolvedExecutable.getAbsolutePath() + "'.");
                 }
             }
         }
@@ -113,29 +118,22 @@
                                                                  String arguments )
         throws ContinuumBuildExecutorException
     {
-        File actualExecutable = resolvedExecutable;
-
         // ----------------------------------------------------------------------
         // If we're not searching the path for the executable, prefix the
         // executable with the working directory to make sure the path is
         // absolute and thus won't be tried resolved by using the PATH
         // ----------------------------------------------------------------------
 
+        String actualExecutable;
+
         if ( !resolveExecutable )
         {
-            actualExecutable = new File( workingDirectory, executable );
+            actualExecutable = new File( workingDirectory, executable ).getAbsolutePath();
         }
-
-        // ----------------------------------------------------------------------
-        // Find the executable to execute in the path
-        // ----------------------------------------------------------------------
-
-        // TODO: actually use the resolved executable. This is disabled now until
-        //       I know that this code actually is working properly on all platforms
-        List path = executableResolver.getDefaultPath();
-
-        if ( resolveExecutable )
+        else
         {
+            List path = executableResolver.getDefaultPath();
+
             if ( StringUtils.isEmpty( executable ) )
             {
                 executable = defaultExecutable;
@@ -153,14 +151,15 @@
 
                     getLogger().warn( element );
                 }
+
+                actualExecutable = defaultExecutable;
             }
             else
             {
                 getLogger().warn( "Using executable '" + e.getAbsolutePath() + "'." );
-            }
 
-            // TODO: remove comment when this code is working properly
-            actualExecutable = e;
+                actualExecutable = e.getAbsolutePath();
+            }
         }
 
         // ----------------------------------------------------------------------
@@ -180,8 +179,9 @@
         }
         catch ( Exception e )
         {
-            throw new ContinuumBuildExecutorException(
-                "Error while executing shell command. The most common error is that " + executable
+ " is not in your path.", e );
+            throw new ContinuumBuildExecutorException( "Error while executing shell command.
" +
+                                                       "The most common error is that '"
+ executable + "' " +
+                                                       "is not in your path.", e );
         }
     }
 }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java?rev=209441&r1=209440&r2=209441&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java
Wed Jul  6 03:24:57 2005
@@ -25,6 +25,8 @@
 import org.apache.maven.continuum.project.AntProject;
 import org.apache.maven.continuum.project.ContinuumProject;
 
+import org.codehaus.plexus.util.StringUtils;
+
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
@@ -65,11 +67,12 @@
 
         String executable = project.getExecutable();
 
-        String targets = project.getTargets();
+        String arguments = StringUtils.clean( project.getCommandLineArguments() ) + " " +
+                           StringUtils.clean( project.getTargets() );
 
         return executeShellCommand( workingDirectory,
                                     executable,
-                                    project.getCommandLineArguments() + " " + targets );
+                                    arguments );
     }
 
     public void updateProjectFromCheckOut( File workingDirectory, ContinuumProject p )

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java?rev=209441&r1=209440&r2=209441&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
Wed Jul  6 03:24:57 2005
@@ -65,10 +65,9 @@
         String commandLine = StringUtils.clean( project.getCommandLineArguments() ) + " "
+
                              StringUtils.clean( project.getGoals() );
 
-        // Adding executable name so that i can get something meaningful in the error message.
-        // If this is not set and there's nothing in the path we have no executable name.
-        
-        return executeShellCommand( workingDirectory, "maven", commandLine );
+        return executeShellCommand( workingDirectory, 
+                                    null,
+                                    commandLine );
     }
 
     public void updateProjectFromCheckOut( File workingDirectory, ContinuumProject project
)

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java?rev=209441&r1=209440&r2=209441&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
Wed Jul  6 03:24:57 2005
@@ -25,6 +25,8 @@
 import org.apache.maven.continuum.project.ContinuumProject;
 import org.apache.maven.continuum.project.MavenTwoProject;
 
+import org.codehaus.plexus.util.StringUtils;
+
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
@@ -68,12 +70,12 @@
 
         File workingDirectory = new File( project.getWorkingDirectory() );
 
-        String arguments = project.getCommandLineArguments() + " " + project.getGoals();
-
-        // Adding executable name so that i can get something meaningful in the error message.
-        // If this is not set and there's nothing in the path we have no executable name.
+        String arguments = StringUtils.clean( project.getCommandLineArguments() ) + " " +
+                           StringUtils.clean( project.getGoals() );
 
-        return executeShellCommand( workingDirectory, "m2", arguments );
+        return executeShellCommand( workingDirectory,
+                                    null,
+                                    arguments );
     }
 
     public void updateProjectFromCheckOut( File workingDirectory, ContinuumProject project
)

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java?rev=209441&r1=209440&r2=209441&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
Wed Jul  6 03:24:57 2005
@@ -20,6 +20,7 @@
 import java.net.URL;
 import java.util.Iterator;
 import java.util.List;
+import java.io.IOException;
 
 import org.apache.maven.continuum.execution.maven.m2.MavenBuilderHelper;
 import org.apache.maven.continuum.execution.maven.m2.MavenBuilderHelperException;
@@ -29,6 +30,7 @@
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuilder;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuilderException;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
+import org.apache.maven.continuum.utils.ContinuumUtils;
 import org.apache.maven.project.MavenProject;
 
 /**
@@ -43,14 +45,18 @@
 
     private static final String POM_PART = "/pom.xml";
 
-    /** @plexus.requirement */
+    /**
+     * @plexus.requirement
+     */
     private MavenBuilderHelper builderHelper;
 
-    /** @plexus.configuration */
+    /**
+     * @plexus.configuration
+     */
     private List excludedPackagingTypes;
 
     // ----------------------------------------------------------------------
-    // ProjectCreator Implementation
+    // AbstractContinuumProjectBuilder Implementation
     // ----------------------------------------------------------------------
 
     public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url )
@@ -62,18 +68,7 @@
 
         ContinuumProjectBuildingResult result = new ContinuumProjectBuildingResult();
 
-        try
-        {
-            readModules( url, result );
-        }
-        catch ( MalformedURLException e )
-        {
-            throw new ContinuumProjectBuilderException( "Error while building Maven project.",
e );
-        }
-        catch ( MavenBuilderHelperException e )
-        {
-            throw new ContinuumProjectBuilderException( "Error while mapping Maven project
to Continuum project.", e );
-        }
+        readModules( url, result );
 
         return result;
     }
@@ -83,7 +78,6 @@
     // ----------------------------------------------------------------------
 
     private void readModules( URL url, ContinuumProjectBuildingResult result )
-        throws MalformedURLException, ContinuumProjectBuilderException, MavenBuilderHelperException
     {
         MavenProject mavenProject;
 
@@ -93,14 +87,31 @@
         }
         catch ( MavenBuilderHelperException e )
         {
-            throw new ContinuumProjectBuilderException( "Error while building Maven project.",
e );
+            // TODO: Use the Error diagnoser from Maven 2 to get a better error message here.
+
+            result.addWarning( ContinuumUtils.throwableToString( e ) );
+
+            return;
+        }
+        catch ( IOException e )
+        {
+            result.addWarning( "Could not download " + url );
+
+            return;
         }
 
         if ( !excludedPackagingTypes.contains( mavenProject.getPackaging() ) )
         {
             MavenTwoProject continuumProject = new MavenTwoProject();
 
-            builderHelper.mapMavenProjectToContinuumProject( mavenProject, continuumProject
);
+            try
+            {
+                builderHelper.mapMavenProjectToContinuumProject( mavenProject, continuumProject
);
+            }
+            catch ( MavenBuilderHelperException e )
+            {
+                result.addWarning( ContinuumUtils.throwableToString( e ) );
+            }
 
             result.addProject( continuumProject, MavenTwoBuildExecutor.ID );
         }
@@ -128,7 +139,20 @@
         {
             String module = (String) it.next();
 
-            URL moduleUrl = new URL( prefix + "/" + module + POM_PART + suffix );
+            URL moduleUrl = null;
+
+            String urlString = prefix + "/" + module + POM_PART + suffix;
+
+            try
+            {
+                moduleUrl = new URL( urlString );
+            }
+            catch ( MalformedURLException e )
+            {
+                result.addWarning( "Could not download project from '" + urlString + "'."
);
+
+                continue;
+            }
 
             readModules( moduleUrl, result );
         }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/AbstractContinuumStore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/AbstractContinuumStore.java?rev=209441&r1=209440&r2=209441&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/AbstractContinuumStore.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/AbstractContinuumStore.java
Wed Jul  6 03:24:57 2005
@@ -16,34 +16,14 @@
  * limitations under the License.
  */
 
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
- * @version $Id: AbstractContinuumStore.java,v 1.1.1.1 2005/03/29 20:42:02 trygvis Exp $
+ * @version $Id$
  */
 public abstract class AbstractContinuumStore
     extends AbstractLogEnabled
     implements ContinuumStore
 {
-    public static String throwableToString( Throwable error )
-    {
-        if ( error == null )
-        {
-            return "";
-        }
-
-        StringWriter writer = new StringWriter();
-
-        PrintWriter printer = new PrintWriter( writer );
-
-        error.printStackTrace( printer );
-
-        printer.flush();
-
-        return writer.getBuffer().toString();
-    }
- }
+}

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java?rev=209441&r1=209440&r2=209441&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/DefaultShellCommandHelper.java
Wed Jul  6 03:24:57 2005
@@ -35,7 +35,7 @@
     // ----------------------------------------------------------------------
 
     public ExecutionResult executeShellCommand( File workingDirectory,
-                                                File executable,
+                                                String executable,
                                                 String arguments )
         throws Exception
     {
@@ -51,7 +51,7 @@
     }
 
     public ExecutionResult executeShellCommand( File workingDirectory,
-                                                File executable,
+                                                String executable,
                                                 String[] arguments )
         throws Exception
     {
@@ -61,9 +61,7 @@
 
         Commandline cl = new Commandline();
 
-        System.out.println( "executable = " + executable );
-
-        cl.setExecutable( executable.getAbsolutePath() );
+        cl.setExecutable( executable );
 
         cl.setWorkingDirectory( workingDirectory.getAbsolutePath() );
 

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/ShellCommandHelper.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/ShellCommandHelper.java?rev=209441&r1=209440&r2=209441&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/ShellCommandHelper.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/utils/shell/ShellCommandHelper.java
Wed Jul  6 03:24:57 2005
@@ -27,12 +27,12 @@
     String ROLE = ShellCommandHelper.class.getName();
 
     ExecutionResult executeShellCommand( File workingDirectory,
-                                         File executable,
+                                         String executable,
                                          String arguments )
         throws Exception;
 
     ExecutionResult executeShellCommand( File workingDirectory,
-                                         File executable,
+                                         String executable,
                                          String[] arguments )
         throws Exception;
 }

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java?rev=209441&r1=209440&r2=209441&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
(original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java
Wed Jul  6 03:24:57 2005
@@ -46,6 +46,10 @@
 
         ContinuumProjectBuildingResult result = projectBuilder.buildProjectsFromMetadata(
pom.toURL() );
 
+        assertNotNull( result.getWarnings() );
+
+        assertEquals( 0, result.getWarnings().size() );
+
         assertNotNull( result.getProjects() );
 
         assertEquals( 1, result.getProjects().size() );
@@ -73,6 +77,10 @@
 
         ContinuumProjectBuildingResult result = projectBuilder.buildProjectsFromMetadata(
pom.toURL() );
 
+        assertNotNull( result.getWarnings() );
+
+        assertEquals( 0, result.getWarnings().size() );
+
         assertNotNull( result.getProjects() );
 
         assertEquals( 1, result.getProjects().size() );
@@ -101,6 +109,20 @@
         ContinuumProjectBuildingResult result = projectBuilder.buildProjectsFromMetadata(
new URL( url ) );
 
         assertNotNull( result );
+
+        // ----------------------------------------------------------------------
+        //
+        // ----------------------------------------------------------------------
+
+        assertNotNull( result.getWarnings() );
+
+        assertEquals( 1, result.getWarnings().size() );
+
+        assertTrue( result.getWarnings().get( 0 ).toString().indexOf( "I'm-not-here-project/pom.xml"
) != -1 );
+
+        // ----------------------------------------------------------------------
+        //
+        // ----------------------------------------------------------------------
 
         assertEquals( 5, result.getProjects().size() );
 

Modified: maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java?rev=209441&r1=209440&r2=209441&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java
(original)
+++ maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStoreTest.java
Wed Jul  6 03:24:57 2005
@@ -26,6 +26,7 @@
 import java.util.Properties;
 
 import org.apache.maven.continuum.AbstractContinuumTest;
+import org.apache.maven.continuum.utils.ContinuumUtils;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutionResult;
 import org.apache.maven.continuum.execution.maven.m2.MavenTwoBuildExecutor;
 import org.apache.maven.continuum.project.ContinuumBuild;
@@ -837,7 +838,7 @@
 
         project.setCheckOutErrorMessage( errorMessage );
 
-        project.setCheckOutErrorException( AbstractContinuumStore.throwableToString( exception
) );
+        project.setCheckOutErrorException( ContinuumUtils.throwableToString( exception )
);
 
         store.updateProject( project );
     }
@@ -856,7 +857,7 @@
 
         build.setEndTime( new Date().getTime() );
 
-        build.setError( AbstractContinuumStore.throwableToString( error ) );
+        build.setError( ContinuumUtils.throwableToString( error ) );
 
         build.setUpdateScmResult( scmResult );
 

Modified: maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/pom.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/pom.xml?rev=209441&r1=209440&r2=209441&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/pom.xml (original)
+++ maven/continuum/trunk/continuum-core/src/test/resources/projects/continuum/pom.xml Wed
Jul  6 03:24:57 2005
@@ -88,5 +88,6 @@
     <module>continuum-plexus-application</module>
     <module>continuum-web</module>
     <module>continuum-xmlrpc</module>
+    <module>I'm-not-here-project</module>
   </modules>
 </project>



Mime
View raw message