continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r210044 - in /maven/continuum/trunk/continuum-core: ./ src/main/java/org/apache/maven/continuum/ src/main/java/org/apache/maven/continuum/core/action/ src/main/java/org/apache/maven/continuum/execution/maven/m1/ src/main/java/org/apache/mav...
Date Sun, 10 Jul 2005 21:42:12 GMT
Author: jvanzyl
Date: Sun Jul 10 14:42:10 2005
New Revision: 210044

URL: http://svn.apache.org/viewcvs?rev=210044&view=rev
Log:
o adding better validation

Modified:
    maven/continuum/trunk/continuum-core/pom.xml
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
    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

Modified: maven/continuum/trunk/continuum-core/pom.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/pom.xml?rev=210044&r1=210043&r2=210044&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/pom.xml (original)
+++ maven/continuum/trunk/continuum-core/pom.xml Sun Jul 10 14:42:10 2005
@@ -58,7 +58,7 @@
     <dependency>
       <groupId>plexus</groupId>
       <artifactId>plexus-action</artifactId>
-      <version>1.0-alpha-1</version>
+      <version>1.0-alpha-3-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>plexus</groupId>

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=210044&r1=210043&r2=210044&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Sun Jul 10 14:42:10 2005
@@ -357,7 +357,12 @@
 
             actionManager.lookup( "create-projects-from-metadata" ).execute( context );
 
-            result = (ContinuumProjectBuildingResult) context.get( CreateProjectsFromMetadata.KEY_PROJECT_BUILDING_RESULT
);
+            result = (ContinuumProjectBuildingResult) context.get( CreateProjectsFromMetadata.KEY_PROJECT_BUILDING_RESULT
);            
+
+            if ( result.getWarnings().size() > 0 )
+            {
+                return result;
+            }
 
             List projects = result.getProjects();
 

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=210044&r1=210043&r2=210044&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
Sun Jul 10 14:42:10 2005
@@ -32,6 +32,7 @@
 import org.apache.maven.continuum.store.ContinuumStoreException;
 
 import org.codehaus.plexus.action.Action;
+import org.codehaus.plexus.action.AbstractAction;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.taskqueue.TaskQueue;
 import org.codehaus.plexus.util.StringUtils;
@@ -41,8 +42,7 @@
  * @version $Id$
  */
 public abstract class AbstractContinuumAction
-    extends AbstractLogEnabled
-    implements Action
+    extends AbstractAction
 {
     // ----------------------------------------------------------------------
     // Keys for the values that can be in the context

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java?rev=210044&r1=210043&r2=210044&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java
Sun Jul 10 14:42:10 2005
@@ -59,6 +59,19 @@
         }
 
         // ----------------------------------------------------------------------
+        // We cannot deal with projects that use the <extend/> element because
+        // we don't have the whole source tree and we might be missing elements
+        // that are present in the parent.
+        // ----------------------------------------------------------------------
+
+        String extend = getValue( mavenProject, "extend", null );
+
+        if ( extend != null )
+        {
+            throw new MavenOneMetadataHelperException( "Cannot use a POM with an 'extend'
element." );
+        }
+
+        // ----------------------------------------------------------------------
         // Populating the descriptor
         // ----------------------------------------------------------------------
 
@@ -67,7 +80,7 @@
 
         if ( StringUtils.isEmpty( name ) )
         {
-            throw new MavenOneMetadataHelperException( "Missing <name> from the project
descriptor." );
+            throw new MavenOneMetadataHelperException( "Missing 'name' element in POM." );
         }
 
         // Scm
@@ -83,7 +96,7 @@
             }
             else
             {
-                throw new MavenOneMetadataHelperException( "The project descriptor is missing
the SCM information." );
+                throw new MavenOneMetadataHelperException( "Missing 'scm' element in the
POM." );
             }
         }
         else
@@ -113,7 +126,7 @@
             }
             else
             {
-                throw new MavenOneMetadataHelperException( "Missing build section." );
+                throw new MavenOneMetadataHelperException( "Missing 'build' element in the
POM." );
             }
         }
         else
@@ -149,7 +162,7 @@
 
         if ( notifiers == null && notifier.getConfiguration().isEmpty() )
         {
-            throw new MavenOneMetadataHelperException( "Missing nag email address from the
project descriptor." );
+            throw new MavenOneMetadataHelperException( "Missing 'nagEmailAddress' element
in the 'build' element in the POM." );
         }
         else
         {
@@ -166,7 +179,7 @@
 
         if ( StringUtils.isEmpty( version ) )
         {
-            throw new MavenOneMetadataHelperException( "Missing version from the project
descriptor." );
+            throw new MavenOneMetadataHelperException( "Missing 'version' element in the
POM." );
         }
 
         // Goals

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java?rev=210044&r1=210043&r2=210044&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
Sun Jul 10 14:42:10 2005
@@ -171,7 +171,11 @@
         }
         catch ( Exception e )
         {
-            throw new MavenBuilderHelperException( "Cannot build maven project from " + file,
e );
+            String msg = "Cannot build maven project from " + file + ".";
+
+            getLogger().error( msg, e );
+
+            throw new MavenBuilderHelperException( msg, e );
         }
 
         // ----------------------------------------------------------------------
@@ -183,12 +187,12 @@
 
         if ( ciManagement == null )
         {
-            throw new MavenBuilderHelperException( "Missing CiManagement from the project
descriptor." );
+            throw new MavenBuilderHelperException( "Missing 'ciManagement' element in the
POM." );
         }
 
         if ( getNotifiers( project ).isEmpty() )
         {
-            throw new MavenBuilderHelperException( "Missing notifiers from the continuous
integration info." );
+            throw new MavenBuilderHelperException( "Missing 'notifiers' element in the 'ciManagement'
element in the POM." );
         }
 
         // SCM connection
@@ -196,20 +200,14 @@
 
         if ( scm == null )
         {
-            throw new MavenBuilderHelperException( "Missing Scm from the project descriptor."
);
+            throw new MavenBuilderHelperException( "Missing 'scm' element in the POM." );
         }
 
         String url = scm.getConnection();
 
         if ( StringUtils.isEmpty( url ) )
         {
-            throw new MavenBuilderHelperException( "Missing anonymous scm connection url."
);
-        }
-
-        // Version
-        if ( StringUtils.isEmpty( project.getVersion() ) )
-        {
-            throw new MavenBuilderHelperException( "Missing version from the project descriptor."
);
+            throw new MavenBuilderHelperException( "Missing 'connection' element in the 'scm'
element in the POM." );
         }
 
         return project;

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=210044&r1=210043&r2=210044&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
Sun Jul 10 14:42:10 2005
@@ -73,7 +73,7 @@
         }
         catch ( MavenOneMetadataHelperException e )
         {
-            result.addWarning( ContinuumUtils.throwableToString( e ) );
+            result.addWarning( e.getMessage() );
         }
 
         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=210044&r1=210043&r2=210044&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
Sun Jul 10 14:42:10 2005
@@ -87,9 +87,7 @@
         }
         catch ( MavenBuilderHelperException e )
         {
-            // TODO: Use the Error diagnoser from Maven 2 to get a better error message here.
-
-            result.addWarning( ContinuumUtils.throwableToString( e ) );
+            result.addWarning( e.getMessage() );
 
             return;
         }



Mime
View raw message