maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r801013 [4/4] - in /maven/components/branches/MNG-4162: ./ apache-maven/ maven-compat/src/main/java/org/apache/maven/artifact/ maven-compat/src/main/java/org/apache/maven/artifact/repository/ maven-compat/src/main/java/org/apache/maven/arti...
Date Tue, 04 Aug 2009 23:11:17 GMT
Modified: maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/composition/DefaultDependencyManagementImporter.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/composition/DefaultDependencyManagementImporter.java?rev=801013&r1=801012&r2=801013&view=diff
==============================================================================
--- maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/composition/DefaultDependencyManagementImporter.java (original)
+++ maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/composition/DefaultDependencyManagementImporter.java Tue Aug  4 23:11:12 2009
@@ -28,6 +28,7 @@
 import org.apache.maven.model.DependencyManagement;
 import org.apache.maven.model.Model;
 import org.apache.maven.model.building.ModelBuildingRequest;
+import org.apache.maven.model.building.ModelProblemCollector;
 import org.codehaus.plexus.component.annotations.Component;
 
 /**
@@ -41,7 +42,7 @@
 {
 
     public void importManagement( Model target, List<? extends DependencyManagement> sources,
-                                  ModelBuildingRequest request )
+                                  ModelBuildingRequest request, ModelProblemCollector problems )
     {
         if ( sources != null && !sources.isEmpty() )
         {

Modified: maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/composition/DependencyManagementImporter.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/composition/DependencyManagementImporter.java?rev=801013&r1=801012&r2=801013&view=diff
==============================================================================
--- maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/composition/DependencyManagementImporter.java (original)
+++ maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/composition/DependencyManagementImporter.java Tue Aug  4 23:11:12 2009
@@ -24,6 +24,7 @@
 import org.apache.maven.model.DependencyManagement;
 import org.apache.maven.model.Model;
 import org.apache.maven.model.building.ModelBuildingRequest;
+import org.apache.maven.model.building.ModelProblemCollector;
 
 /**
  * Handles the import of dependency management from other models into the target model.
@@ -39,7 +40,9 @@
      * @param target The model into which to import the dependency management section, must not be <code>null</code>.
      * @param sources The dependency management sections to import, may be <code>null</code>.
      * @param request The model building request that holds further settings, must not be {@code null}.
+     * @param problems The container used to collect problems that were encountered, must not be {@code null}.
      */
-    void importManagement( Model target, List<? extends DependencyManagement> sources, ModelBuildingRequest request );
+    void importManagement( Model target, List<? extends DependencyManagement> sources, ModelBuildingRequest request,
+                           ModelProblemCollector problems );
 
 }

Modified: maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/inheritance/DefaultInheritanceAssembler.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/inheritance/DefaultInheritanceAssembler.java?rev=801013&r1=801012&r2=801013&view=diff
==============================================================================
--- maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/inheritance/DefaultInheritanceAssembler.java (original)
+++ maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/inheritance/DefaultInheritanceAssembler.java Tue Aug  4 23:11:12 2009
@@ -32,6 +32,7 @@
 import org.apache.maven.model.ReportPlugin;
 import org.apache.maven.model.Reporting;
 import org.apache.maven.model.building.ModelBuildingRequest;
+import org.apache.maven.model.building.ModelProblemCollector;
 import org.apache.maven.model.merge.MavenModelMerger;
 import org.codehaus.plexus.component.annotations.Component;
 
@@ -47,7 +48,8 @@
 
     private InheritanceModelMerger merger = new InheritanceModelMerger();
 
-    public void assembleModelInheritance( Model child, Model parent, ModelBuildingRequest request )
+    public void assembleModelInheritance( Model child, Model parent, ModelBuildingRequest request,
+                                          ModelProblemCollector problems )
     {
         Map<Object, Object> hints = new HashMap<Object, Object>();
         hints.put( MavenModelMerger.CHILD_PATH_ADJUSTMENT, getChildPathAdjustment( child, parent ) );

Modified: maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/inheritance/InheritanceAssembler.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/inheritance/InheritanceAssembler.java?rev=801013&r1=801012&r2=801013&view=diff
==============================================================================
--- maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/inheritance/InheritanceAssembler.java (original)
+++ maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/inheritance/InheritanceAssembler.java Tue Aug  4 23:11:12 2009
@@ -21,6 +21,7 @@
 
 import org.apache.maven.model.Model;
 import org.apache.maven.model.building.ModelBuildingRequest;
+import org.apache.maven.model.building.ModelProblemCollector;
 
 /**
  * Handles inheritance of model values.
@@ -39,7 +40,9 @@
      *            <code>null</code>.
      * @param parent The (read-only) parent model from which to inherit the values, may be <code>null</code>.
      * @param request The model building request that holds further settings, must not be {@code null}.
+     * @param problems The container used to collect problems that were encountered, must not be {@code null}.
      */
-    void assembleModelInheritance( Model child, Model parent, ModelBuildingRequest request );
+    void assembleModelInheritance( Model child, Model parent, ModelBuildingRequest request,
+                                   ModelProblemCollector problems );
 
 }

Modified: maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/AbstractStringBasedModelInterpolator.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/AbstractStringBasedModelInterpolator.java?rev=801013&r1=801012&r2=801013&view=diff
==============================================================================
--- maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/AbstractStringBasedModelInterpolator.java (original)
+++ maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/AbstractStringBasedModelInterpolator.java Tue Aug  4 23:11:12 2009
@@ -21,6 +21,7 @@
 
 import org.apache.maven.model.Model;
 import org.apache.maven.model.building.ModelBuildingRequest;
+import org.apache.maven.model.building.ModelProblemCollector;
 import org.apache.maven.model.path.PathTranslator;
 import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.interpolation.AbstractValueSource;
@@ -187,8 +188,8 @@
     }
     
     protected String interpolateInternal( String src, List<? extends ValueSource> valueSources,
-                                          List<? extends InterpolationPostProcessor> postProcessors )
-        throws ModelInterpolationException
+                                          List<? extends InterpolationPostProcessor> postProcessors,
+                                          ModelProblemCollector problems )
     {
         if ( src.indexOf( "${" ) < 0 )
         {
@@ -215,9 +216,9 @@
                 {
                     result = interpolator.interpolate( result, recursionInterceptor );
                 }
-                catch( InterpolationException e )
+                catch ( InterpolationException e )
                 {
-                    throw new ModelInterpolationException( e.getMessage(), e );
+                    problems.addError( e.getMessage(), e );
                 }
 
                 interpolator.clearFeedback();

Modified: maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/ModelInterpolator.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/ModelInterpolator.java?rev=801013&r1=801012&r2=801013&view=diff
==============================================================================
--- maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/ModelInterpolator.java (original)
+++ maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/ModelInterpolator.java Tue Aug  4 23:11:12 2009
@@ -21,6 +21,7 @@
 
 import org.apache.maven.model.Model;
 import org.apache.maven.model.building.ModelBuildingRequest;
+import org.apache.maven.model.building.ModelProblemCollector;
 
 import java.io.File;
 
@@ -44,11 +45,9 @@
      * @param projectDir The project directory, may be {@code null} if the model does not belong to a local project but
      *            to some artifact's metadata.
      * @param request The model building request that holds further settings, must not be {@code null}.
+     * @param problems The container used to collect problems that were encountered, must not be {@code null}.
      * @return The interpolated model, never {@code null}.
-     * @throws ModelInterpolationException If the model could not be interpolated (e.g. due to expressions with cyclic
-     *             references).
      */
-    Model interpolateModel( Model model, File projectDir, ModelBuildingRequest request )
-        throws ModelInterpolationException;
+    Model interpolateModel( Model model, File projectDir, ModelBuildingRequest request, ModelProblemCollector problems );
 
 }

Modified: maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringSearchModelInterpolator.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringSearchModelInterpolator.java?rev=801013&r1=801012&r2=801013&view=diff
==============================================================================
--- maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringSearchModelInterpolator.java (original)
+++ maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/StringSearchModelInterpolator.java Tue Aug  4 23:11:12 2009
@@ -21,6 +21,7 @@
 
 import org.apache.maven.model.Model;
 import org.apache.maven.model.building.ModelBuildingRequest;
+import org.apache.maven.model.building.ModelProblemCollector;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.interpolation.InterpolationPostProcessor;
 import org.codehaus.plexus.interpolation.Interpolator;
@@ -47,16 +48,15 @@
     private static final Map<Class<?>, Field[]> fieldsByClass = new WeakHashMap<Class<?>, Field[]>();
     private static final Map<Class<?>, Boolean> fieldIsPrimitiveByClass = new WeakHashMap<Class<?>, Boolean>();
 
-    public Model interpolateModel( Model model, File projectDir, ModelBuildingRequest config )
-        throws ModelInterpolationException
+    public Model interpolateModel( Model model, File projectDir, ModelBuildingRequest config,
+                                   ModelProblemCollector problems )
     {
-        interpolateObject( model, model, projectDir, config );
+        interpolateObject( model, model, projectDir, config, problems );
         
         return model;
     }
     
-    protected void interpolateObject( Object obj, Model model, File projectDir, ModelBuildingRequest config )
-        throws ModelInterpolationException
+    protected void interpolateObject( Object obj, Model model, File projectDir, ModelBuildingRequest config, ModelProblemCollector problems )
     {
         try
         {
@@ -64,14 +64,9 @@
             List<? extends InterpolationPostProcessor> postProcessors = createPostProcessors( model, projectDir, config );
             
             InterpolateObjectAction action =
-                new InterpolateObjectAction( obj, valueSources, postProcessors, this );
+                new InterpolateObjectAction( obj, valueSources, postProcessors, this, problems );
             
-            ModelInterpolationException error = AccessController.doPrivileged( action );
-            
-            if ( error != null )
-            {
-                throw error;
-            }
+            AccessController.doPrivileged( action );
         }
         finally
         {
@@ -87,17 +82,18 @@
         return interpolator;
     }
     
-    private static final class InterpolateObjectAction implements PrivilegedAction<ModelInterpolationException>
+    private static final class InterpolateObjectAction implements PrivilegedAction<Object>
     {
 
         private final LinkedList<Object> interpolationTargets;
         private final StringSearchModelInterpolator modelInterpolator;
         private final List<? extends ValueSource> valueSources;
         private final List<? extends InterpolationPostProcessor> postProcessors;
+        private final ModelProblemCollector problems;
         
         public InterpolateObjectAction( Object target, List<? extends ValueSource> valueSources,
                                         List<? extends InterpolationPostProcessor> postProcessors,
-                                        StringSearchModelInterpolator modelInterpolator )
+                                        StringSearchModelInterpolator modelInterpolator, ModelProblemCollector problems )
         {
             this.valueSources = valueSources;
             this.postProcessors = postProcessors;
@@ -106,22 +102,17 @@
             interpolationTargets.add( target );
             
             this.modelInterpolator = modelInterpolator;
+
+            this.problems = problems;
         }
 
-        public ModelInterpolationException run()
+        public Object run()
         {
             while( !interpolationTargets.isEmpty() )
             {
                 Object obj = interpolationTargets.removeFirst();
                 
-                try
-                {
-                    traverseObjectWithParents( obj.getClass(), obj );
-                }
-                catch ( ModelInterpolationException e )
-                {
-                    return e;
-                }
+                traverseObjectWithParents( obj.getClass(), obj );
             }
             
             return null;
@@ -129,7 +120,6 @@
 
         @SuppressWarnings("unchecked")
         private void traverseObjectWithParents( Class<?> cls, Object target )
-            throws ModelInterpolationException
         {
             if ( cls == null )
             {
@@ -166,7 +156,9 @@
                                     String value = (String) fields[i].get( target );
                                     if ( value != null )
                                     {
-                                        String interpolated = modelInterpolator.interpolateInternal( value, valueSources, postProcessors );
+                                        String interpolated =
+                                            modelInterpolator.interpolateInternal( value, valueSources, postProcessors,
+                                                                                   problems );
                                         
                                         if ( !interpolated.equals( value ) )
                                         {
@@ -195,7 +187,10 @@
                                             {
                                                 if( String.class == value.getClass() )
                                                 {
-                                                    String interpolated = modelInterpolator.interpolateInternal( (String) value, valueSources, postProcessors );
+                                                    String interpolated =
+                                                        modelInterpolator.interpolateInternal( (String) value,
+                                                                                               valueSources,
+                                                                                               postProcessors, problems );
                                                     
                                                     if ( !interpolated.equals( value ) )
                                                     {
@@ -240,7 +235,10 @@
                                             {
                                                 if( String.class == value.getClass() )
                                                 {
-                                                    String interpolated = modelInterpolator.interpolateInternal( (String) value, valueSources, postProcessors );
+                                                    String interpolated =
+                                                        modelInterpolator.interpolateInternal( (String) value,
+                                                                                               valueSources,
+                                                                                               postProcessors, problems );
                                                     
                                                     if ( !interpolated.equals( value ) )
                                                     {
@@ -287,11 +285,13 @@
                             }
                             catch ( IllegalArgumentException e )
                             {
-                                throw new ModelInterpolationException( "Failed to interpolate field: " + fields[i] + " on class: " + cls.getName(), e );
+                                problems.addError( "Failed to interpolate field: " + fields[i] + " on class: "
+                                    + cls.getName(), e );
                             }
                             catch ( IllegalAccessException e )
                             {
-                                throw new ModelInterpolationException( "Failed to interpolate field: " + fields[i] + " on class: " + cls.getName(), e );
+                                problems.addError( "Failed to interpolate field: " + fields[i] + " on class: "
+                                    + cls.getName(), e );
                             }
                         }
                         finally
@@ -336,7 +336,6 @@
         }
 
         private void evaluateArray( Object target )
-            throws ModelInterpolationException
         {
             int len = Array.getLength( target );
             for( int i = 0; i < len; i++ )
@@ -346,7 +345,9 @@
                 {
                     if ( String.class == value.getClass() )
                     {
-                        String interpolated = modelInterpolator.interpolateInternal( (String) value, valueSources, postProcessors );
+                        String interpolated =
+                            modelInterpolator.interpolateInternal( (String) value, valueSources, postProcessors,
+                                                                   problems );
                         
                         if ( !interpolated.equals( value ) )
                         {

Modified: maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultDependencyManagementInjector.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultDependencyManagementInjector.java?rev=801013&r1=801012&r2=801013&view=diff
==============================================================================
--- maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultDependencyManagementInjector.java (original)
+++ maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultDependencyManagementInjector.java Tue Aug  4 23:11:12 2009
@@ -30,6 +30,7 @@
 import org.apache.maven.model.Exclusion;
 import org.apache.maven.model.Model;
 import org.apache.maven.model.building.ModelBuildingRequest;
+import org.apache.maven.model.building.ModelProblemCollector;
 import org.apache.maven.model.merge.MavenModelMerger;
 import org.codehaus.plexus.component.annotations.Component;
 
@@ -45,7 +46,7 @@
 
     private ManagementModelMerger merger = new ManagementModelMerger();
 
-    public void injectManagement( Model model, ModelBuildingRequest request )
+    public void injectManagement( Model model, ModelBuildingRequest request, ModelProblemCollector problems )
     {
         merger.mergeManagedDependencies( model );
     }

Modified: maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultPluginManagementInjector.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultPluginManagementInjector.java?rev=801013&r1=801012&r2=801013&view=diff
==============================================================================
--- maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultPluginManagementInjector.java (original)
+++ maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultPluginManagementInjector.java Tue Aug  4 23:11:12 2009
@@ -33,6 +33,7 @@
 import org.apache.maven.model.PluginExecution;
 import org.apache.maven.model.PluginManagement;
 import org.apache.maven.model.building.ModelBuildingRequest;
+import org.apache.maven.model.building.ModelProblemCollector;
 import org.apache.maven.model.merge.MavenModelMerger;
 import org.codehaus.plexus.component.annotations.Component;
 
@@ -48,12 +49,12 @@
 
     private ManagementModelMerger merger = new ManagementModelMerger();
 
-    public void injectManagement( Model model, ModelBuildingRequest request )
+    public void injectManagement( Model model, ModelBuildingRequest request, ModelProblemCollector problems )
     {
         merger.mergeManagedBuildPlugins( model, false );
     }
 
-    public void injectBasicManagement( Model model, ModelBuildingRequest request )
+    public void injectBasicManagement( Model model, ModelBuildingRequest request, ModelProblemCollector problems )
     {
         merger.mergeManagedBuildPlugins( model, true );
     }

Modified: maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/management/DependencyManagementInjector.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/management/DependencyManagementInjector.java?rev=801013&r1=801012&r2=801013&view=diff
==============================================================================
--- maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/management/DependencyManagementInjector.java (original)
+++ maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/management/DependencyManagementInjector.java Tue Aug  4 23:11:12 2009
@@ -21,6 +21,7 @@
 
 import org.apache.maven.model.Model;
 import org.apache.maven.model.building.ModelBuildingRequest;
+import org.apache.maven.model.building.ModelProblemCollector;
 
 /**
  * Handles injection of dependency management into the model.
@@ -36,7 +37,8 @@
      * @param child The model into which to merge the values specified by its dependency management sections, must not
      *            be <code>null</code>.
      * @param request The model building request that holds further settings, must not be {@code null}.
+     * @param problems The container used to collect problems that were encountered, must not be {@code null}.
      */
-    void injectManagement( Model child, ModelBuildingRequest request );
+    void injectManagement( Model child, ModelBuildingRequest request, ModelProblemCollector problems );
 
 }

Modified: maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/management/PluginManagementInjector.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/management/PluginManagementInjector.java?rev=801013&r1=801012&r2=801013&view=diff
==============================================================================
--- maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/management/PluginManagementInjector.java (original)
+++ maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/management/PluginManagementInjector.java Tue Aug  4 23:11:12 2009
@@ -21,6 +21,7 @@
 
 import org.apache.maven.model.Model;
 import org.apache.maven.model.building.ModelBuildingRequest;
+import org.apache.maven.model.building.ModelProblemCollector;
 
 /**
  * Handles injection of plugin management into the model.
@@ -36,8 +37,9 @@
      * @param child The model into which to merge the values specified by its plugin management section, must not be
      *            <code>null</code>.
      * @param request The model building request that holds further settings, must not be {@code null}.
+     * @param problems The container used to collect problems that were encountered, must not be {@code null}.
      */
-    void injectManagement( Model child, ModelBuildingRequest request );
+    void injectManagement( Model child, ModelBuildingRequest request, ModelProblemCollector problems );
 
     /**
      * Merges important default values from the plugin management section of the given model into itself. In detail,
@@ -47,7 +49,8 @@
      * @param child The model into which to merge the values specified by its plugin management section, must not be
      *            <code>null</code>.
      * @param request The model building request that holds further settings, must not be {@code null}.
+     * @param problems The container used to collect problems that were encountered, must not be {@code null}.
      */
-    void injectBasicManagement( Model child, ModelBuildingRequest request );
+    void injectBasicManagement( Model child, ModelBuildingRequest request, ModelProblemCollector problems );
 
 }

Modified: maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/normalization/DefaultModelNormalizer.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/normalization/DefaultModelNormalizer.java?rev=801013&r1=801012&r2=801013&view=diff
==============================================================================
--- maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/normalization/DefaultModelNormalizer.java (original)
+++ maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/normalization/DefaultModelNormalizer.java Tue Aug  4 23:11:12 2009
@@ -30,6 +30,7 @@
 import org.apache.maven.model.Model;
 import org.apache.maven.model.Plugin;
 import org.apache.maven.model.building.ModelBuildingRequest;
+import org.apache.maven.model.building.ModelProblemCollector;
 import org.apache.maven.model.merge.MavenModelMerger;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.util.StringUtils;
@@ -46,7 +47,7 @@
 
     private DuplicateMerger merger = new DuplicateMerger();
 
-    public void mergeDuplicates( Model model, ModelBuildingRequest request )
+    public void mergeDuplicates( Model model, ModelBuildingRequest request, ModelProblemCollector problems )
     {
         Build build = model.getBuild();
         if ( build != null )
@@ -95,7 +96,7 @@
 
     }
 
-    public void injectDefaultValues( Model model, ModelBuildingRequest request )
+    public void injectDefaultValues( Model model, ModelBuildingRequest request, ModelProblemCollector problems )
     {
         injectDependencyDefaults( model.getDependencies() );
 

Modified: maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/normalization/ModelNormalizer.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/normalization/ModelNormalizer.java?rev=801013&r1=801012&r2=801013&view=diff
==============================================================================
--- maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/normalization/ModelNormalizer.java (original)
+++ maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/normalization/ModelNormalizer.java Tue Aug  4 23:11:12 2009
@@ -21,6 +21,7 @@
 
 import org.apache.maven.model.Model;
 import org.apache.maven.model.building.ModelBuildingRequest;
+import org.apache.maven.model.building.ModelProblemCollector;
 
 /**
  * Handles normalization of a model. In this context, normalization is the process of producing a canonical
@@ -34,10 +35,11 @@
     /**
      * Merges duplicate elements like multiple declarations of the same build plugin in the specified model.
      * 
-     * @param model The model whose duplicate elements should be merged, must not be <code>null</code>.
+     * @param model The model whose duplicate elements should be merged, must not be {@code null}.
      * @param request The model building request that holds further settings, must not be {@code null}.
+     * @param problems The container used to collect problems that were encountered, must not be {@code null}.
      */
-    void mergeDuplicates( Model model, ModelBuildingRequest request );
+    void mergeDuplicates( Model model, ModelBuildingRequest request, ModelProblemCollector problems );
 
     /**
      * Sets default values in the specified model that for technical reasons cannot be set directly in the Modello
@@ -45,7 +47,8 @@
      * 
      * @param model The model in which to set the default values, must not be {@code null}.
      * @param request The model building request that holds further settings, must not be {@code null}.
+     * @param problems The container used to collect problems that were encountered, must not be {@code null}.
      */
-    void injectDefaultValues( Model model, ModelBuildingRequest request );
+    void injectDefaultValues( Model model, ModelBuildingRequest request, ModelProblemCollector problems );
 
 }

Propchange: maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/path/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug  4 23:11:12 2009
@@ -4,5 +4,5 @@
 /maven/components/branches/sisbell-plugin-manager/maven-compat/src/main/java/org/apache/maven/project/path:738973-739966
 /maven/components/sisbell-plugin-manager/maven-compat/src/main/java/org/apache/maven/project/path:738757-738972
 /maven/components/trunk/maven-compat/src/main/java/org/apache/maven/project/path:751453-767358,767708-768832
-/maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/path:799928-799938
+/maven/components/trunk/maven-model-builder/src/main/java/org/apache/maven/model/path:799928-800992
 /maven/components/trunk/maven-project/src/main/java/org/apache/maven/project/path:688587-696625,696644-699681

Modified: maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/plugin/DefaultPluginConfigurationExpander.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/plugin/DefaultPluginConfigurationExpander.java?rev=801013&r1=801012&r2=801013&view=diff
==============================================================================
--- maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/plugin/DefaultPluginConfigurationExpander.java (original)
+++ maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/plugin/DefaultPluginConfigurationExpander.java Tue Aug  4 23:11:12 2009
@@ -27,6 +27,7 @@
 import org.apache.maven.model.ReportSet;
 import org.apache.maven.model.Reporting;
 import org.apache.maven.model.building.ModelBuildingRequest;
+import org.apache.maven.model.building.ModelProblemCollector;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.util.xml.Xpp3Dom;
 
@@ -40,7 +41,7 @@
     implements PluginConfigurationExpander
 {
 
-    public void expandPluginConfiguration( Model model, ModelBuildingRequest request )
+    public void expandPluginConfiguration( Model model, ModelBuildingRequest request, ModelProblemCollector problems )
     {
         Build build = model.getBuild();
         Reporting reporting = model.getReporting();

Modified: maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/plugin/LifecycleBindingsInjector.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/plugin/LifecycleBindingsInjector.java?rev=801013&r1=801012&r2=801013&view=diff
==============================================================================
--- maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/plugin/LifecycleBindingsInjector.java (original)
+++ maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/plugin/LifecycleBindingsInjector.java Tue Aug  4 23:11:12 2009
@@ -20,6 +20,7 @@
  */
 
 import org.apache.maven.model.Model;
+import org.apache.maven.model.building.ModelProblemCollector;
 
 /**
  * Handles injection of plugin executions induced by the lifecycle bindings for a packaging.
@@ -34,7 +35,8 @@
      * 
      * @param model The model into which to inject the default plugin executions for its packaging, must not be
      *            <code>null</code>.
+     * @param problems The container used to collect problems that were encountered, must not be {@code null}.
      */
-    void injectLifecycleBindings( Model model );
+    void injectLifecycleBindings( Model model, ModelProblemCollector problems );
 
 }

Modified: maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/plugin/PluginConfigurationExpander.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/plugin/PluginConfigurationExpander.java?rev=801013&r1=801012&r2=801013&view=diff
==============================================================================
--- maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/plugin/PluginConfigurationExpander.java (original)
+++ maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/plugin/PluginConfigurationExpander.java Tue Aug  4 23:11:12 2009
@@ -21,6 +21,7 @@
 
 import org.apache.maven.model.Model;
 import org.apache.maven.model.building.ModelBuildingRequest;
+import org.apache.maven.model.building.ModelProblemCollector;
 
 /**
  * Handles expansion of general plugin configuration into individual executions and report sets.
@@ -36,7 +37,8 @@
      * 
      * @param model The model whose plugin configuration should be expanded, must not be <code>null</code>.
      * @param request The model building request that holds further settings, must not be {@code null}.
+     * @param problems The container used to collect problems that were encountered, must not be {@code null}.
      */
-    void expandPluginConfiguration( Model model, ModelBuildingRequest request );
+    void expandPluginConfiguration( Model model, ModelBuildingRequest request, ModelProblemCollector problems );
 
 }

Modified: maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/profile/DefaultProfileInjector.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/profile/DefaultProfileInjector.java?rev=801013&r1=801012&r2=801013&view=diff
==============================================================================
--- maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/profile/DefaultProfileInjector.java (original)
+++ maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/profile/DefaultProfileInjector.java Tue Aug  4 23:11:12 2009
@@ -36,6 +36,7 @@
 import org.apache.maven.model.ReportPlugin;
 import org.apache.maven.model.Reporting;
 import org.apache.maven.model.building.ModelBuildingRequest;
+import org.apache.maven.model.building.ModelProblemCollector;
 import org.apache.maven.model.merge.MavenModelMerger;
 import org.codehaus.plexus.component.annotations.Component;
 
@@ -51,7 +52,8 @@
 
     private ProfileModelMerger merger = new ProfileModelMerger();
 
-    public void injectProfile( Model model, Profile profile, ModelBuildingRequest request )
+    public void injectProfile( Model model, Profile profile, ModelBuildingRequest request,
+                               ModelProblemCollector problems )
     {
         if ( profile != null )
         {

Modified: maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/profile/DefaultProfileSelector.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/profile/DefaultProfileSelector.java?rev=801013&r1=801012&r2=801013&view=diff
==============================================================================
--- maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/profile/DefaultProfileSelector.java (original)
+++ maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/profile/DefaultProfileSelector.java Tue Aug  4 23:11:12 2009
@@ -26,6 +26,7 @@
 
 import org.apache.maven.model.Activation;
 import org.apache.maven.model.Profile;
+import org.apache.maven.model.building.ModelProblemCollector;
 import org.apache.maven.model.profile.activation.ProfileActivator;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
@@ -43,7 +44,8 @@
     @Requirement( role = ProfileActivator.class )
     private List<ProfileActivator> activators;
 
-    public ProfileSelectionResult getActiveProfiles( Collection<Profile> profiles, ProfileActivationContext context )
+    public List<Profile> getActiveProfiles( Collection<Profile> profiles, ProfileActivationContext context,
+                                            ModelProblemCollector problems )
     {
         Collection<String> activatedIds = new HashSet<String>( context.getActiveProfileIds() );
         Collection<String> deactivatedIds = new HashSet<String>( context.getInactiveProfileIds() );
@@ -52,13 +54,11 @@
         List<Profile> activePomProfilesByDefault = new ArrayList<Profile>();
         boolean activatedPomProfileNotByDefault = false;
 
-        List<ProfileActivationException> activationExceptions = new ArrayList<ProfileActivationException>();
-
         for ( Profile profile : profiles )
         {
             if ( !deactivatedIds.contains( profile.getId() ) )
             {
-                if ( activatedIds.contains( profile.getId() ) || isActive( profile, context, activationExceptions ) )
+                if ( activatedIds.contains( profile.getId() ) || isActive( profile, context, problems ) )
                 {
                     activeProfiles.add( profile );
 
@@ -87,15 +87,10 @@
             activeProfiles.addAll( activePomProfilesByDefault );
         }
 
-        ProfileSelectionResult result = new ProfileSelectionResult();
-        result.setActiveProfiles( activeProfiles );
-        result.setActivationExceptions( activationExceptions );
-
-        return result;
+        return activeProfiles;
     }
 
-    private boolean isActive( Profile profile, ProfileActivationContext context,
-                              List<ProfileActivationException> exceptions )
+    private boolean isActive( Profile profile, ProfileActivationContext context, ModelProblemCollector problems )
     {
         for ( ProfileActivator activator : activators )
         {
@@ -108,7 +103,8 @@
             }
             catch ( ProfileActivationException e )
             {
-                exceptions.add( e );
+                problems.addError( "Invalid activation condition for profile " + profile.getId() + ": "
+                    + e.getMessage() );
             }
         }
         return false;

Modified: maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/profile/ProfileInjector.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/profile/ProfileInjector.java?rev=801013&r1=801012&r2=801013&view=diff
==============================================================================
--- maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/profile/ProfileInjector.java (original)
+++ maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/profile/ProfileInjector.java Tue Aug  4 23:11:12 2009
@@ -22,6 +22,7 @@
 import org.apache.maven.model.Model;
 import org.apache.maven.model.Profile;
 import org.apache.maven.model.building.ModelBuildingRequest;
+import org.apache.maven.model.building.ModelProblemCollector;
 
 /**
  * Handles profile injection into the model.
@@ -38,7 +39,8 @@
      * @param model The model into which to merge the values defined by the profile, must not be <code>null</code>.
      * @param profile The (read-only) profile whose values should be injected, may be <code>null</code>.
      * @param request The model building request that holds further settings, must not be {@code null}.
+     * @param problems The container used to collect problems that were encountered, must not be {@code null}.
      */
-    void injectProfile( Model model, Profile profile, ModelBuildingRequest request );
+    void injectProfile( Model model, Profile profile, ModelBuildingRequest request, ModelProblemCollector problems );
 
 }

Modified: maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/profile/ProfileSelector.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/profile/ProfileSelector.java?rev=801013&r1=801012&r2=801013&view=diff
==============================================================================
--- maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/profile/ProfileSelector.java (original)
+++ maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/profile/ProfileSelector.java Tue Aug  4 23:11:12 2009
@@ -20,8 +20,10 @@
  */
 
 import java.util.Collection;
+import java.util.List;
 
 import org.apache.maven.model.Profile;
+import org.apache.maven.model.building.ModelProblemCollector;
 
 /**
  * Calculates the active profiles among a given collection of profiles.
@@ -38,8 +40,10 @@
      * @param profiles The profiles whose activation status should be determined, must not be {@code null}.
      * @param context The environmental context used to determine the activation status of a profile, must not be
      *            {@code null}.
-     * @return The result of the selection process, never {@code null}.
+     * @param problems The container used to collect problems that were encountered, must not be {@code null}.
+     * @return The profiles that have been activated, never {@code null}.
      */
-    ProfileSelectionResult getActiveProfiles( Collection<Profile> profiles, ProfileActivationContext context );
+    List<Profile> getActiveProfiles( Collection<Profile> profiles, ProfileActivationContext context,
+                                     ModelProblemCollector problems );
 
 }

Modified: maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java?rev=801013&r1=801012&r2=801013&view=diff
==============================================================================
--- maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java (original)
+++ maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java Tue Aug  4 23:11:12 2009
@@ -36,6 +36,7 @@
 import org.apache.maven.model.Repository;
 import org.apache.maven.model.Resource;
 import org.apache.maven.model.building.ModelBuildingRequest;
+import org.apache.maven.model.building.ModelProblemCollector;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.util.StringUtils;
 
@@ -50,78 +51,72 @@
 
     private static final String ID_REGEX = "[A-Za-z0-9_\\-.]+";
 
-    public ModelValidationResult validateRawModel( Model model, ModelBuildingRequest request )
+    public void validateRawModel( Model model, ModelBuildingRequest request, ModelProblemCollector problems )
     {
-        ModelValidationResult result = new ModelValidationResult();
-
         Parent parent = model.getParent();
         if ( parent != null )
         {
-            validateStringNotEmpty( "parent.groupId", result, false, parent.getGroupId() );
+            validateStringNotEmpty( "parent.groupId", problems, false, parent.getGroupId() );
 
-            validateStringNotEmpty( "parent.artifactId", result, false, parent.getArtifactId() );
+            validateStringNotEmpty( "parent.artifactId", problems, false, parent.getArtifactId() );
 
-            validateStringNotEmpty( "parent.version", result, false, parent.getVersion() );
+            validateStringNotEmpty( "parent.version", problems, false, parent.getVersion() );
 
             if ( parent.getGroupId().equals( model.getGroupId() )
                 && parent.getArtifactId().equals( model.getArtifactId() ) )
             {
-                addViolation( result, false, "The parent element cannot have the same ID as the project." );
+                addViolation( problems, false, "The parent element cannot have the same ID as the project." );
             }
         }
 
         if ( request.getValidationLevel() >= ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_2_0 )
         {
-            validateDependencies( result, model.getDependencies(), "dependencies.dependency", request );
+            validateDependencies( problems, model.getDependencies(), "dependencies.dependency", request );
 
             if ( model.getDependencyManagement() != null )
             {
-                validateDependencies( result, model.getDependencyManagement().getDependencies(),
+                validateDependencies( problems, model.getDependencyManagement().getDependencies(),
                                       "dependencyManagement.dependencies.dependency", request );
             }
 
-            validateRepositories( result, model.getRepositories(), "repositories.repository", request );
+            validateRepositories( problems, model.getRepositories(), "repositories.repository", request );
 
-            validateRepositories( result, model.getPluginRepositories(), "pluginRepositories.pluginRepository", request );
+            validateRepositories( problems, model.getPluginRepositories(), "pluginRepositories.pluginRepository", request );
 
             for ( Profile profile : model.getProfiles() )
             {
-                validateDependencies( result, profile.getDependencies(), "profiles.profile[" + profile.getId()
+                validateDependencies( problems, profile.getDependencies(), "profiles.profile[" + profile.getId()
                     + "].dependencies.dependency", request );
 
                 if ( profile.getDependencyManagement() != null )
                 {
-                    validateDependencies( result, profile.getDependencyManagement().getDependencies(),
+                    validateDependencies( problems, profile.getDependencyManagement().getDependencies(),
                                           "profiles.profile[" + profile.getId()
                                               + "].dependencyManagement.dependencies.dependency", request );
                 }
 
-                validateRepositories( result, profile.getRepositories(), "profiles.profile[" + profile.getId()
+                validateRepositories( problems, profile.getRepositories(), "profiles.profile[" + profile.getId()
                     + "].repositories.repository", request );
 
-                validateRepositories( result, profile.getPluginRepositories(), "profiles.profile[" + profile.getId()
+                validateRepositories( problems, profile.getPluginRepositories(), "profiles.profile[" + profile.getId()
                     + "].pluginRepositories.pluginRepository", request );
             }
         }
-
-        return result;
     }
 
-    public ModelValidationResult validateEffectiveModel( Model model, ModelBuildingRequest request )
+    public void validateEffectiveModel( Model model, ModelBuildingRequest request, ModelProblemCollector problems )
     {
-        ModelValidationResult result = new ModelValidationResult();
+        validateStringNotEmpty( "modelVersion", problems, false, model.getModelVersion() );
 
-        validateStringNotEmpty( "modelVersion", result, false, model.getModelVersion() );
+        validateId( "groupId", problems, model.getGroupId() );
 
-        validateId( "groupId", result, model.getGroupId() );
+        validateId( "artifactId", problems, model.getArtifactId() );
 
-        validateId( "artifactId", result, model.getArtifactId() );
-
-        validateStringNotEmpty( "packaging", result, false, model.getPackaging() );
+        validateStringNotEmpty( "packaging", problems, false, model.getPackaging() );
 
         if ( !model.getModules().isEmpty() && !"pom".equals( model.getPackaging() ) )
         {
-            addViolation( result, false, "Packaging '" + model.getPackaging() + "' is invalid. Aggregator projects " +
+            addViolation( problems, false, "Packaging '" + model.getPackaging() + "' is invalid. Aggregator projects " +
                 "require 'pom' as packaging." );
         }
 
@@ -131,21 +126,21 @@
             if ( parent.getGroupId().equals( model.getGroupId() ) &&
                 parent.getArtifactId().equals( model.getArtifactId() ) )
             {
-                addViolation( result, false, "The parent element cannot have the same ID as the project." );
+                addViolation( problems, false, "The parent element cannot have the same ID as the project." );
             }
         }
 
-        validateStringNotEmpty( "version", result, false, model.getVersion() );
+        validateStringNotEmpty( "version", problems, false, model.getVersion() );
 
         for ( Dependency d : model.getDependencies() )
         {
-            validateId( "dependencies.dependency.artifactId", result, d.getArtifactId() );
+            validateId( "dependencies.dependency.artifactId", problems, d.getArtifactId() );
 
-            validateId( "dependencies.dependency.groupId", result, d.getGroupId() );
+            validateId( "dependencies.dependency.groupId", problems, d.getGroupId() );
 
-            validateStringNotEmpty( "dependencies.dependency.type", result, false, d.getType(), d.getManagementKey() );
+            validateStringNotEmpty( "dependencies.dependency.type", problems, false, d.getType(), d.getManagementKey() );
 
-            validateStringNotEmpty( "dependencies.dependency.version", result, false, d.getVersion(),
+            validateStringNotEmpty( "dependencies.dependency.version", problems, false, d.getVersion(),
                                     d.getManagementKey() );
 
             if ( "system".equals( d.getScope() ) )
@@ -154,20 +149,20 @@
 
                 if ( StringUtils.isEmpty( systemPath ) )
                 {
-                    addViolation( result, false, "For dependency " + d + ": system-scoped dependency must specify systemPath." );
+                    addViolation( problems, false, "For dependency " + d + ": system-scoped dependency must specify systemPath." );
                 }
                 else
                 {
                     if ( !new File( systemPath ).isAbsolute() )
                     {
-                        addViolation( result, false, "For dependency " + d + ": system-scoped dependency must " +
+                        addViolation( problems, false, "For dependency " + d + ": system-scoped dependency must " +
                             "specify an absolute path systemPath." );
                     }
                 }
             }
             else if ( StringUtils.isNotEmpty( d.getSystemPath() ) )
             {
-                addViolation( result, false,
+                addViolation( problems, false,
                     "For dependency " + d + ": only dependency with system scope can specify systemPath." );
             }
         }
@@ -177,10 +172,10 @@
         {
             for ( Dependency d : mgmt.getDependencies() )
             {
-                validateSubElementStringNotEmpty( d, "dependencyManagement.dependencies.dependency.artifactId", result,
+                validateSubElementStringNotEmpty( d, "dependencyManagement.dependencies.dependency.artifactId", problems,
                                                   d.getArtifactId() );
 
-                validateSubElementStringNotEmpty( d, "dependencyManagement.dependencies.dependency.groupId", result,
+                validateSubElementStringNotEmpty( d, "dependencyManagement.dependencies.dependency.groupId", problems,
                                                   d.getGroupId() );
 
                 if ( "system".equals( d.getScope() ) )
@@ -189,21 +184,21 @@
 
                     if ( StringUtils.isEmpty( systemPath ) )
                     {
-                        addViolation( result, false,
+                        addViolation( problems, false,
                             "For managed dependency " + d + ": system-scoped dependency must specify systemPath." );
                     }
                     else
                     {
                         if ( !new File( systemPath ).isAbsolute() )
                         {
-                            addViolation( result, false, "For managed dependency " + d + ": system-scoped dependency must " +
+                            addViolation( problems, false, "For managed dependency " + d + ": system-scoped dependency must " +
                                 "specify an absolute path systemPath." );
                         }
                     }
                 }
                 else if ( StringUtils.isNotEmpty( d.getSystemPath() ) )
                 {
-                    addViolation( result, false,
+                    addViolation( problems, false,
                         "For managed dependency " + d + ": only dependency with system scope can specify systemPath." );
                 }
             }
@@ -219,17 +214,17 @@
             {
                 for ( Plugin p : build.getPlugins() )
                 {
-                    validateStringNotEmpty( "build.plugins.plugin.artifactId", result, false, p.getArtifactId() );
+                    validateStringNotEmpty( "build.plugins.plugin.artifactId", problems, false, p.getArtifactId() );
 
-                    validateStringNotEmpty( "build.plugins.plugin.groupId", result, false, p.getGroupId() );
+                    validateStringNotEmpty( "build.plugins.plugin.groupId", problems, false, p.getGroupId() );
 
-                    validateStringNotEmpty( "build.plugins.plugin.version", result, warnOnMissingPluginVersion,
+                    validateStringNotEmpty( "build.plugins.plugin.version", problems, warnOnMissingPluginVersion,
                                             p.getVersion(), p.getKey() );
                 }
 
-                validateResources( result, build.getResources(), "build.resources.resource" );
+                validateResources( problems, build.getResources(), "build.resources.resource" );
 
-                validateResources( result, build.getTestResources(), "build.testResources.testResource" );
+                validateResources( problems, build.getTestResources(), "build.testResources.testResource" );
             }
 
             Reporting reporting = model.getReporting();
@@ -237,24 +232,22 @@
             {
                 for ( ReportPlugin p : reporting.getPlugins() )
                 {
-                    validateStringNotEmpty( "reporting.plugins.plugin.artifactId", result, false, p.getArtifactId() );
+                    validateStringNotEmpty( "reporting.plugins.plugin.artifactId", problems, false, p.getArtifactId() );
 
-                    validateStringNotEmpty( "reporting.plugins.plugin.groupId", result, false, p.getGroupId() );
+                    validateStringNotEmpty( "reporting.plugins.plugin.groupId", problems, false, p.getGroupId() );
 
-                    validateStringNotEmpty( "reporting.plugins.plugin.version", result, warnOnMissingPluginVersion,
+                    validateStringNotEmpty( "reporting.plugins.plugin.version", problems, warnOnMissingPluginVersion,
                                             p.getVersion(), p.getKey() );
                 }
             }
 
-            forcePluginExecutionIdCollision( model, result );
+            forcePluginExecutionIdCollision( model, problems );
         }
-
-        return result;
     }
 
-    private boolean validateId( String fieldName, ModelValidationResult result, String id )
+    private boolean validateId( String fieldName, ModelProblemCollector problems, String id )
     {
-        if ( !validateStringNotEmpty( fieldName, result, false, id ) )
+        if ( !validateStringNotEmpty( fieldName, problems, false, id ) )
         {
             return false;
         }
@@ -263,13 +256,13 @@
             boolean match = id.matches( ID_REGEX );
             if ( !match )
             {
-                addViolation( result, false, "'" + fieldName + "' with value '" + id + "' does not match a valid id pattern." );
+                addViolation( problems, false, "'" + fieldName + "' with value '" + id + "' does not match a valid id pattern." );
             }
             return match;
         }
     }
 
-    private void validateDependencies( ModelValidationResult result, List<Dependency> dependencies, String prefix,
+    private void validateDependencies( ModelProblemCollector problems, List<Dependency> dependencies, String prefix,
                                        ModelBuildingRequest request )
     {
         Map<String, Dependency> index = new HashMap<String, Dependency>();
@@ -281,7 +274,7 @@
             if ( "pom".equals( dependency.getType() ) && "import".equals( dependency.getScope() )
                 && StringUtils.isNotEmpty( dependency.getClassifier() ) )
             {
-                addViolation( result, false, "'" + prefix + ".classifier' must be empty for imported POM: " + key );
+                addViolation( problems, false, "'" + prefix + ".classifier' must be empty for imported POM: " + key );
             }
 
             Dependency existing = index.get( key );
@@ -290,7 +283,7 @@
             {
                 boolean warning = request.getValidationLevel() < ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_3_0;
 
-                addViolation( result, warning, "'" + prefix + ".(groupId:artifactId:type:classifier)' must be unique: "
+                addViolation( problems, warning, "'" + prefix + ".(groupId:artifactId:type:classifier)' must be unique: "
                     + key + " -> " + existing.getVersion() + " vs " + dependency.getVersion() );
             }
             else
@@ -300,16 +293,16 @@
         }
     }
 
-    private void validateRepositories( ModelValidationResult result, List<Repository> repositories, String prefix,
+    private void validateRepositories( ModelProblemCollector problems, List<Repository> repositories, String prefix,
                                        ModelBuildingRequest request )
     {
         Map<String, Repository> index = new HashMap<String, Repository>();
 
         for ( Repository repository : repositories )
         {
-            validateStringNotEmpty( prefix + ".id", result, false, repository.getId() );
+            validateStringNotEmpty( prefix + ".id", problems, false, repository.getId() );
 
-            validateStringNotEmpty( prefix + ".url", result, false, repository.getUrl() );
+            validateStringNotEmpty( prefix + "[" + repository.getId() + "].url", problems, false, repository.getUrl() );
 
             String key = repository.getId();
 
@@ -319,7 +312,7 @@
             {
                 boolean warning = request.getValidationLevel() < ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_3_0;
 
-                addViolation( result, warning, "'" + prefix + ".id' must be unique: " + repository.getId() + " -> "
+                addViolation( problems, warning, "'" + prefix + ".id' must be unique: " + repository.getId() + " -> "
                     + existing.getUrl() + " vs " + repository.getUrl() );
             }
             else
@@ -329,15 +322,15 @@
         }
     }
 
-    private void validateResources( ModelValidationResult result, List<Resource> resources, String prefix )
+    private void validateResources( ModelProblemCollector problems, List<Resource> resources, String prefix )
     {
         for ( Resource resource : resources )
         {
-            validateStringNotEmpty( prefix + ".directory", result, false, resource.getDirectory() );
+            validateStringNotEmpty( prefix + ".directory", problems, false, resource.getDirectory() );
         }
     }
 
-    private void forcePluginExecutionIdCollision( Model model, ModelValidationResult result )
+    private void forcePluginExecutionIdCollision( Model model, ModelProblemCollector problems )
     {
         Build build = model.getBuild();
 
@@ -356,7 +349,7 @@
                     }
                     catch ( IllegalStateException collisionException )
                     {
-                        addViolation( result, false, collisionException.getMessage() );
+                        addViolation( problems, false, collisionException.getMessage() );
                     }
                 }
             }
@@ -367,9 +360,9 @@
     // Field validation
     // ----------------------------------------------------------------------
 
-    private boolean validateStringNotEmpty( String fieldName, ModelValidationResult result, boolean warning, String string )
+    private boolean validateStringNotEmpty( String fieldName, ModelProblemCollector problems, boolean warning, String string )
     {
-        return validateStringNotEmpty( fieldName, result, warning, string, null );
+        return validateStringNotEmpty( fieldName, problems, warning, string, null );
     }
 
     /**
@@ -380,10 +373,10 @@
      * <li><code>string.length > 0</code>
      * </ul>
      */
-    private boolean validateStringNotEmpty( String fieldName, ModelValidationResult result, boolean warning,
+    private boolean validateStringNotEmpty( String fieldName, ModelProblemCollector problems, boolean warning,
                                             String string, String sourceHint )
     {
-        if ( !validateNotNull( fieldName, result, warning, string, sourceHint ) )
+        if ( !validateNotNull( fieldName, problems, warning, string, sourceHint ) )
         {
             return false;
         }
@@ -395,11 +388,11 @@
 
         if ( sourceHint != null )
         {
-            addViolation( result, false, "'" + fieldName + "' is missing for " + sourceHint );
+            addViolation( problems, false, "'" + fieldName + "' is missing for " + sourceHint );
         }
         else
         {
-            addViolation( result, false, "'" + fieldName + "' is missing." );
+            addViolation( problems, false, "'" + fieldName + "' is missing." );
         }
 
         return false;
@@ -414,9 +407,9 @@
      * </ul>
      */
     private boolean validateSubElementStringNotEmpty( Object subElementInstance, String fieldName,
-                                                      ModelValidationResult result, String string )
+                                                      ModelProblemCollector problems, String string )
     {
-        if ( !validateSubElementNotNull( subElementInstance, fieldName, result, string ) )
+        if ( !validateSubElementNotNull( subElementInstance, fieldName, problems, string ) )
         {
             return false;
         }
@@ -426,7 +419,7 @@
             return true;
         }
 
-        addViolation( result, false, "In " + subElementInstance + ":\n\n       -> '" + fieldName + "' is missing." );
+        addViolation( problems, false, "In " + subElementInstance + ":\n\n       -> '" + fieldName + "' is missing." );
 
         return false;
     }
@@ -438,7 +431,7 @@
      * <li><code>string != null</code>
      * </ul>
      */
-    private boolean validateNotNull( String fieldName, ModelValidationResult result, boolean warning, Object object, String sourceHint )
+    private boolean validateNotNull( String fieldName, ModelProblemCollector problems, boolean warning, Object object, String sourceHint )
     {
         if ( object != null )
         {
@@ -447,11 +440,11 @@
 
         if ( sourceHint != null )
         {
-            addViolation( result, warning, "'" + fieldName + "' is missing for " + sourceHint );
+            addViolation( problems, warning, "'" + fieldName + "' is missing for " + sourceHint );
         }
         else
         {
-            addViolation( result, warning, "'" + fieldName + "' is missing." );
+            addViolation( problems, warning, "'" + fieldName + "' is missing." );
         }
 
         return false;
@@ -465,27 +458,27 @@
      * </ul>
      */
     private boolean validateSubElementNotNull( Object subElementInstance, String fieldName,
-                                               ModelValidationResult result, Object object )
+                                               ModelProblemCollector problems, Object object )
     {
         if ( object != null )
         {
             return true;
         }
 
-        addViolation( result, false, "In " + subElementInstance + ":\n\n       -> '" + fieldName + "' is missing." );
+        addViolation( problems, false, "In " + subElementInstance + ":\n\n       -> '" + fieldName + "' is missing." );
 
         return false;
     }
 
-    private void addViolation( ModelValidationResult result, boolean warning, String message )
+    private void addViolation( ModelProblemCollector problems, boolean warning, String message )
     {
         if ( warning )
         {
-            result.addWarning( message );
+            problems.addWarning( message );
         }
         else
         {
-            result.addError( message );
+            problems.addError( message );
         }
     }
 

Modified: maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/validation/ModelValidator.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/validation/ModelValidator.java?rev=801013&r1=801012&r2=801013&view=diff
==============================================================================
--- maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/validation/ModelValidator.java (original)
+++ maven/components/branches/MNG-4162/maven-model-builder/src/main/java/org/apache/maven/model/validation/ModelValidator.java Tue Aug  4 23:11:12 2009
@@ -21,6 +21,7 @@
 
 import org.apache.maven.model.Model;
 import org.apache.maven.model.building.ModelBuildingRequest;
+import org.apache.maven.model.building.ModelProblemCollector;
 
 /**
  * Checks the model for missing or invalid values.
@@ -37,9 +38,9 @@
      * 
      * @param model The model to validate, must not be {@code null}.
      * @param request The model building request that holds further settings, must not be {@code null}.
-     * @return The result of the validation, never {@code null}.
+     * @param problems The container used to collect problems that were encountered, must not be {@code null}.
      */
-    ModelValidationResult validateRawModel( Model model, ModelBuildingRequest request );
+    void validateRawModel( Model model, ModelBuildingRequest request, ModelProblemCollector problems );
 
     /**
      * Checks the specified (effective) model for missing or invalid values. The effective model is fully assembled and
@@ -47,8 +48,8 @@
      * 
      * @param model The model to validate, must not be {@code null}.
      * @param request The model building request that holds further settings, must not be {@code null}.
-     * @return The result of the validation, never {@code null}.
+     * @param problems The container used to collect problems that were encountered, must not be {@code null}.
      */
-    ModelValidationResult validateEffectiveModel( Model model, ModelBuildingRequest request );
+    void validateEffectiveModel( Model model, ModelBuildingRequest request, ModelProblemCollector problems );
 
 }

Propchange: maven/components/branches/MNG-4162/maven-model-builder/src/main/mdo/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug  4 23:11:12 2009
@@ -3,4 +3,4 @@
 /maven/components/branches/maven-2.0.x/maven-profile/src/main/mdo:679206
 /maven/components/branches/sisbell-plugin-manager/maven-project/src/main/mdo:738973-739966
 /maven/components/sisbell-plugin-manager/maven-project/src/main/mdo:738757-738972
-/maven/components/trunk/maven-model-builder/src/main/mdo:767708-768832,799928-799938
+/maven/components/trunk/maven-model-builder/src/main/mdo:767708-768832,799928-800992

Propchange: maven/components/branches/MNG-4162/maven-model-builder/src/main/resources/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug  4 23:11:12 2009
@@ -3,5 +3,5 @@
 /maven/components/branches/maven-2.0.x/maven-project/src/main/resources:679206,720042
 /maven/components/branches/sisbell-plugin-manager/maven-project-builder/src/main/resources:738973-739966
 /maven/components/sisbell-plugin-manager/maven-project-builder/src/main/resources:738757-738972
-/maven/components/trunk/maven-model-builder/src/main/resources:767708-768832,799928-799938
+/maven/components/trunk/maven-model-builder/src/main/resources:767708-768832,799928-800992
 /maven/components/trunk/maven-project/src/main/resources:688587-696625,696644-699681

Propchange: maven/components/branches/MNG-4162/maven-model-builder/src/test/java/org/apache/maven/model/validation/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug  4 23:11:12 2009
@@ -4,5 +4,5 @@
 /maven/components/branches/maven-2.1.x/maven-project/src/test/java/org/apache/maven/project/validation:739385,741841,747468,747683,748815,749612,766523,768817
 /maven/components/branches/sisbell-plugin-manager/maven-project/src/test/java/org/apache/maven/project/validation:738973-739966
 /maven/components/sisbell-plugin-manager/maven-project/src/test/java/org/apache/maven/project/validation:738757-738972
-/maven/components/trunk/maven-model-builder/src/test/java/org/apache/maven/model/validation:799928-799938
+/maven/components/trunk/maven-model-builder/src/test/java/org/apache/maven/model/validation:799928-800992
 /maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/validation:751453-767358,767708-768832

Modified: maven/components/branches/MNG-4162/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-4162/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java?rev=801013&r1=801012&r2=801013&view=diff
==============================================================================
--- maven/components/branches/MNG-4162/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java (original)
+++ maven/components/branches/MNG-4162/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java Tue Aug  4 23:11:12 2009
@@ -20,11 +20,13 @@
  */
 
 import java.io.InputStream;
+import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.maven.model.Model;
 import org.apache.maven.model.building.DefaultModelBuildingRequest;
 import org.apache.maven.model.building.ModelBuildingRequest;
+import org.apache.maven.model.building.ModelProblemCollector;
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.codehaus.plexus.PlexusTestCase;
 
@@ -38,6 +40,46 @@
 
     private DefaultModelValidator validator;
 
+    private static class SimpleProblemCollector
+        implements ModelProblemCollector
+    {
+
+        private List<String> warnings = new ArrayList<String>();
+
+        private List<String> errors = new ArrayList<String>();
+
+        public void addError( String message )
+        {
+            errors.add( message );
+        }
+
+        public void addError( String message, Exception cause )
+        {
+            addError( message );
+        }
+
+        public void addWarning( String message )
+        {
+            warnings.add( message );
+        }
+
+        public void addWarning( String message, Exception cause )
+        {
+            addWarning( message );
+        }
+
+        public List<String> getWarnings()
+        {
+            return warnings;
+        }
+
+        public List<String> getErrors()
+        {
+            return errors;
+        }
+
+    }
+
     private Model read( String pom )
         throws Exception
     {
@@ -47,26 +89,34 @@
         return new MavenXpp3Reader().read( is );
     }
 
-    private ModelValidationResult validate( String pom )
+    private SimpleProblemCollector validate( String pom )
         throws Exception
     {
         return validateEffective( pom, ModelBuildingRequest.VALIDATION_LEVEL_STRICT );
     }
 
-    private ModelValidationResult validateEffective( String pom, int level )
+    private SimpleProblemCollector validateEffective( String pom, int level )
         throws Exception
     {
         ModelBuildingRequest request = new DefaultModelBuildingRequest().setValidationLevel( level );
 
-        return validator.validateEffectiveModel( read( pom ), request );
+        SimpleProblemCollector problems = new SimpleProblemCollector();
+
+        validator.validateEffectiveModel( read( pom ), request, problems );
+
+        return problems;
     }
 
-    private ModelValidationResult validateRaw( String pom, int level )
+    private SimpleProblemCollector validateRaw( String pom, int level )
         throws Exception
     {
         ModelBuildingRequest request = new DefaultModelBuildingRequest().setValidationLevel( level );
 
-        return validator.validateRawModel( read( pom ), request );
+        SimpleProblemCollector problems = new SimpleProblemCollector();
+
+        validator.validateRawModel( read( pom ), request, problems );
+
+        return problems;
     }
 
     @Override
@@ -87,7 +137,7 @@
         super.tearDown();
     }
 
-    private void assertViolations( ModelValidationResult result, int errors, int warnings )
+    private void assertViolations( SimpleProblemCollector result, int errors, int warnings )
     {
         assertEquals( errors, result.getErrors().size() );
         assertEquals( warnings, result.getWarnings().size() );
@@ -96,7 +146,7 @@
     public void testMissingModelVersion()
         throws Exception
     {
-        ModelValidationResult result = validate( "missing-modelVersion-pom.xml" );
+        SimpleProblemCollector result = validate( "missing-modelVersion-pom.xml" );
 
         assertViolations( result, 1, 0 );
 
@@ -106,7 +156,7 @@
     public void testMissingArtifactId()
         throws Exception
     {
-        ModelValidationResult result = validate( "missing-artifactId-pom.xml" );
+        SimpleProblemCollector result = validate( "missing-artifactId-pom.xml" );
 
         assertViolations( result, 1, 0 );
 
@@ -116,7 +166,7 @@
     public void testMissingGroupId()
         throws Exception
     {
-        ModelValidationResult result = validate( "missing-groupId-pom.xml" );
+        SimpleProblemCollector result = validate( "missing-groupId-pom.xml" );
 
         assertViolations( result, 1, 0 );
 
@@ -126,7 +176,7 @@
     public void testInvalidIds()
         throws Exception
     {
-        ModelValidationResult result = validate( "invalid-ids-pom.xml" );
+        SimpleProblemCollector result = validate( "invalid-ids-pom.xml" );
 
         assertViolations( result, 2, 0 );
 
@@ -138,7 +188,7 @@
     public void testMissingType()
         throws Exception
     {
-        ModelValidationResult result = validate( "missing-type-pom.xml" );
+        SimpleProblemCollector result = validate( "missing-type-pom.xml" );
 
         assertViolations( result, 1, 0 );
 
@@ -148,7 +198,7 @@
     public void testMissingVersion()
         throws Exception
     {
-        ModelValidationResult result = validate( "missing-version-pom.xml" );
+        SimpleProblemCollector result = validate( "missing-version-pom.xml" );
 
         assertViolations( result, 1, 0 );
 
@@ -158,7 +208,7 @@
     public void testInvalidAggregatorPackaging()
         throws Exception
     {
-        ModelValidationResult result = validate( "invalid-aggregator-packaging-pom.xml" );
+        SimpleProblemCollector result = validate( "invalid-aggregator-packaging-pom.xml" );
 
         assertViolations( result, 1, 0 );
 
@@ -168,7 +218,7 @@
     public void testMissingDependencyArtifactId()
         throws Exception
     {
-        ModelValidationResult result = validate( "missing-dependency-artifactId-pom.xml" );
+        SimpleProblemCollector result = validate( "missing-dependency-artifactId-pom.xml" );
 
         assertViolations( result, 1, 0 );
 
@@ -178,7 +228,7 @@
     public void testMissingDependencyGroupId()
         throws Exception
     {
-        ModelValidationResult result = validate( "missing-dependency-groupId-pom.xml" );
+        SimpleProblemCollector result = validate( "missing-dependency-groupId-pom.xml" );
 
         assertViolations( result, 1, 0 );
 
@@ -188,7 +238,7 @@
     public void testMissingDependencyVersion()
         throws Exception
     {
-        ModelValidationResult result = validate( "missing-dependency-version-pom.xml" );
+        SimpleProblemCollector result = validate( "missing-dependency-version-pom.xml" );
 
         assertViolations( result, 1, 0 );
 
@@ -198,7 +248,7 @@
     public void testMissingDependencyManagementArtifactId()
         throws Exception
     {
-        ModelValidationResult result = validate( "missing-dependency-mgmt-artifactId-pom.xml" );
+        SimpleProblemCollector result = validate( "missing-dependency-mgmt-artifactId-pom.xml" );
 
         assertViolations( result, 1, 0 );
 
@@ -209,7 +259,7 @@
     public void testMissingDependencyManagementGroupId()
         throws Exception
     {
-        ModelValidationResult result = validate( "missing-dependency-mgmt-groupId-pom.xml" );
+        SimpleProblemCollector result = validate( "missing-dependency-mgmt-groupId-pom.xml" );
 
         assertViolations( result, 1, 0 );
 
@@ -220,7 +270,7 @@
     public void testMissingAll()
         throws Exception
     {
-        ModelValidationResult result = validate( "missing-1-pom.xml" );
+        SimpleProblemCollector result = validate( "missing-1-pom.xml" );
 
         assertViolations( result, 4, 0 );
 
@@ -236,7 +286,7 @@
     public void testMissingPluginArtifactId()
         throws Exception
     {
-        ModelValidationResult result = validate( "missing-plugin-artifactId-pom.xml" );
+        SimpleProblemCollector result = validate( "missing-plugin-artifactId-pom.xml" );
 
         assertViolations( result, 1, 0 );
 
@@ -246,7 +296,7 @@
     public void testMissingPluginVersion()
         throws Exception
     {
-        ModelValidationResult result =
+        SimpleProblemCollector result =
             validateEffective( "missing-plugin-version-pom.xml", ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_3_1 );
 
         assertViolations( result, 1, 0 );
@@ -262,24 +312,24 @@
     public void testMissingRepositoryId()
         throws Exception
     {
-        ModelValidationResult result =
+        SimpleProblemCollector result =
             validateRaw( "missing-repository-id-pom.xml", ModelBuildingRequest.VALIDATION_LEVEL_STRICT );
 
         assertViolations( result, 4, 0 );
 
         assertEquals( "'repositories.repository.id' is missing.", result.getErrors().get( 0 ) );
 
-        assertEquals( "'repositories.repository.url' is missing.", result.getErrors().get( 1 ) );
+        assertEquals( "'repositories.repository[null].url' is missing.", result.getErrors().get( 1 ) );
 
         assertEquals( "'pluginRepositories.pluginRepository.id' is missing.", result.getErrors().get( 2 ) );
 
-        assertEquals( "'pluginRepositories.pluginRepository.url' is missing.", result.getErrors().get( 3 ) );
+        assertEquals( "'pluginRepositories.pluginRepository[null].url' is missing.", result.getErrors().get( 3 ) );
     }
 
     public void testMissingResourceDirectory()
         throws Exception
     {
-        ModelValidationResult result = validate( "missing-resource-directory-pom.xml" );
+        SimpleProblemCollector result = validate( "missing-resource-directory-pom.xml" );
 
         assertViolations( result, 2, 0 );
 

Propchange: maven/components/branches/MNG-4162/maven-plugin-api/src/main/java/org/apache/maven/monitor/logging/DefaultLog.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug  4 23:11:12 2009
@@ -5,4 +5,4 @@
 /maven/components/branches/sisbell-plugin-manager/maven-core/src/main/java/org/apache/maven/monitor/logging/DefaultLog.java:738973-739966
 /maven/components/sisbell-plugin-manager/maven-core/src/main/java/org/apache/maven/monitor/logging/DefaultLog.java:738757-738972
 /maven/components/trunk/maven-core/src/main/java/org/apache/maven/monitor/logging/DefaultLog.java:688587-696625,696644-699681
-/maven/components/trunk/maven-plugin-api/src/main/java/org/apache/maven/monitor/logging/DefaultLog.java:799928-799938
+/maven/components/trunk/maven-plugin-api/src/main/java/org/apache/maven/monitor/logging/DefaultLog.java:799928-800992

Modified: maven/components/branches/MNG-4162/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-4162/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java?rev=801013&r1=801012&r2=801013&view=diff
==============================================================================
--- maven/components/branches/MNG-4162/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java (original)
+++ maven/components/branches/MNG-4162/maven-plugin-api/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptor.java Tue Aug  4 23:11:12 2009
@@ -227,6 +227,12 @@
         this.inheritedByDefault = inheritedByDefault;
     }
 
+    /**
+     * Gets the artifacts that make up the plugin's class realm, excluding artifacts shadowed by the Maven core realm
+     * like {@code maven-project}.
+     * 
+     * @return The plugin artifacts, never {@code null}.
+     */
     public List<Artifact> getArtifacts()
     {
         return artifacts;
@@ -277,7 +283,7 @@
 
         MojoDescriptor mojoDescriptor = null;
         
-        for ( Iterator i = getMojos().iterator(); i.hasNext() && mojoDescriptor == null; )
+        for ( Iterator<?> i = getMojos().iterator(); i.hasNext() && mojoDescriptor == null; )
         {
             MojoDescriptor desc = (MojoDescriptor) i.next();
                         



Mime
View raw message