continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r443219 - /maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
Date Thu, 14 Sep 2006 04:16:25 GMT
Author: carlos
Date: Wed Sep 13 21:16:24 2006
New Revision: 443219

URL: http://svn.apache.org/viewvc?view=rev&rev=443219
Log:
Handle error when parent pom is not available

Modified:
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java?view=diff&rev=443219&r1=443218&r2=443219
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
(original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
Wed Sep 13 21:16:24 2006
@@ -20,6 +20,7 @@
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
 import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
+import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.ProjectDependency;
 import org.apache.maven.continuum.model.project.ProjectDeveloper;
@@ -37,6 +38,7 @@
 import org.apache.maven.project.InvalidProjectModelException;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.project.ProjectBuildingException;
 import org.apache.maven.project.validation.ModelValidationResult;
 import org.apache.maven.settings.MavenSettingsBuilder;
 import org.apache.maven.settings.Mirror;
@@ -335,6 +337,30 @@
                 writeActiveProfileStatement( project );
             }
 
+        }
+        catch ( ProjectBuildingException e )
+        {
+            Throwable cause = e.getCause();
+
+            while ( ( cause.getCause() != null ) && ( cause instanceof ProjectBuildingException
) )
+            {
+                cause = cause.getCause();
+            }
+
+            if ( cause instanceof ArtifactNotFoundException )
+            {
+                result.addError( ContinuumProjectBuildingResult.ERROR_ARTIFACT_NOT_FOUND,
+                                 ( (ArtifactNotFoundException) cause ).toString() );
+                return null;
+            }
+
+            result.addError( ContinuumProjectBuildingResult.ERROR_PROJECT_BUILDING, e.getMessage()
);
+
+            String msg = "Cannot build maven project from " + file + " (" + e.getMessage()
+ ").";
+
+            getLogger().error( msg, e );
+
+            return null;
         }
         catch ( Exception e )
         {



Mime
View raw message