continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tryg...@apache.org
Subject svn commit: r209446 - in /maven/continuum/trunk/continuum-core/src: main/java/org/apache/maven/continuum/project/builder/maven/ test/java/org/apache/maven/continuum/project/builder/maven/
Date Wed, 06 Jul 2005 11:15:25 GMT
Author: trygvis
Date: Wed Jul  6 04:15:21 2005
New Revision: 209446

URL: http://svn.apache.org/viewcvs?rev=209446&view=rev
Log:
o Woops, properly catching and storing exceptions.

Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilder.java
    maven/continuum/trunk/continuum-core/src/test/java/org/apache/maven/continuum/project/builder/maven/MavenTwoContinuumProjectBuilderTest.java

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java?rev=209446&r1=209445&r2=209446&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/maven/MavenOneContinuumProjectBuilder.java
Wed Jul  6 04:15:21 2005
@@ -17,6 +17,7 @@
  */
 
 import java.io.File;
+import java.io.IOException;
 import java.net.URL;
 
 import org.apache.maven.continuum.execution.maven.m1.MavenOneBuildExecutor;
@@ -25,8 +26,8 @@
 import org.apache.maven.continuum.project.MavenOneProject;
 import org.apache.maven.continuum.project.builder.AbstractContinuumProjectBuilder;
 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;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -46,11 +47,23 @@
     // ----------------------------------------------------------------------
 
     public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url )
-        throws ContinuumProjectBuilderException
     {
         ContinuumProjectBuildingResult result = new ContinuumProjectBuildingResult();
 
-        File pomFile = createMetadataFile( url );
+        File pomFile;
+
+        try
+        {
+            pomFile = createMetadataFile( url );
+        }
+        catch ( IOException e )
+        {
+            getLogger().warn( "Could not download the URL", e );
+
+            result.addWarning( "Could not download the URL '" + url + "'." );
+
+            return result;
+        }
 
         MavenOneProject project = new MavenOneProject();
 
@@ -60,7 +73,7 @@
         }
         catch ( MavenOneMetadataHelperException e )
         {
-            throw new ContinuumProjectBuilderException( "Cannot create continuum project.",
e );
+            result.addWarning( ContinuumUtils.throwableToString( e ) );
         }
 
         result.addProject( project, MavenOneBuildExecutor.ID );

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=209446&r1=209445&r2=209446&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 04:15:21 2005
@@ -95,6 +95,8 @@
         }
         catch ( IOException e )
         {
+            getLogger().warn( "Could not download the URL", e );
+
             result.addWarning( "Could not download " + url );
 
             return;

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=209446&r1=209445&r2=209446&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 04:15:21 2005
@@ -17,6 +17,8 @@
  */
 
 import java.io.File;
+import java.io.PrintStream;
+import java.io.ByteArrayOutputStream;
 import java.net.URL;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -106,7 +108,14 @@
 
         String url = getTestFile( "src/test/resources/projects/continuum/pom.xml" ).toURL().toExternalForm();
 
+        // Eat System.out
+        PrintStream ps = System.out;
+
+        System.setOut( new PrintStream( new ByteArrayOutputStream() ) );
+
         ContinuumProjectBuildingResult result = projectBuilder.buildProjectsFromMetadata(
new URL( url ) );
+
+        System.setOut( ps );
 
         assertNotNull( result );
 



Mime
View raw message