maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aherit...@apache.org
Subject [04/50] git commit: [MNG-5477] finally removed reporting plugin version validation since a warning is issued in maven-site-plugin in case of missing version. Then removed reporting plugin version injection too
Date Mon, 15 Jul 2013 22:26:02 GMT
[MNG-5477] finally removed reporting plugin version validation since a
warning is issued in maven-site-plugin in case of missing version. Then
removed reporting plugin version injection too

Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/f34b4fbd
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/f34b4fbd
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/f34b4fbd

Branch: refs/heads/slf4j-logback
Commit: f34b4fbdfc543c29bce11754996183b5c1a0fbc4
Parents: 00b9029
Author: Hervé Boutemy <hboutemy@apache.org>
Authored: Thu May 23 18:42:34 2013 +0200
Committer: Hervé Boutemy <hboutemy@apache.org>
Committed: Thu May 23 18:54:08 2013 +0200

----------------------------------------------------------------------
 .../DefaultPluginManagementInjector.java        | 38 ------------------
 .../model/validation/DefaultModelValidator.java |  3 --
 .../validation/DefaultModelValidatorTest.java   | 42 +-------------------
 3 files changed, 1 insertion(+), 82 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/f34b4fbd/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultPluginManagementInjector.java
----------------------------------------------------------------------
diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultPluginManagementInjector.java
b/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultPluginManagementInjector.java
index abd8d94..a13d4fd 100644
--- a/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultPluginManagementInjector.java
+++ b/maven-model-builder/src/main/java/org/apache/maven/model/management/DefaultPluginManagementInjector.java
@@ -31,8 +31,6 @@ import org.apache.maven.model.Plugin;
 import org.apache.maven.model.PluginContainer;
 import org.apache.maven.model.PluginExecution;
 import org.apache.maven.model.PluginManagement;
-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;
@@ -69,12 +67,6 @@ public class DefaultPluginManagementInjector
                 {
                     mergePluginContainer_Plugins( build, pluginManagement );
                 }
-
-                mergeReporting_Plugins( model.getReporting(), build );
-                if ( pluginManagement != null )
-                {
-                    mergeReporting_Plugins( model.getReporting(), pluginManagement );
-                }
             }
         }
 
@@ -139,36 +131,6 @@ public class DefaultPluginManagementInjector
                 target.setExecutions( new ArrayList<PluginExecution>( merged.values()
) );
             }
         }
-
-        /**
-         * merge plugin version to reporting if report plugin version not set
-         */
-        private void mergeReporting_Plugins( Reporting target, PluginContainer source )
-        {
-            List<Plugin> src = source.getPlugins();
-            if ( !src.isEmpty() )
-            {
-                List<ReportPlugin> tgt = target.getPlugins();
-
-                Map<Object, Plugin> managedPlugins = new LinkedHashMap<Object, Plugin>(
src.size() * 2 );
-
-                for ( Plugin element : src )
-                {
-                    Object key = getPluginKey( element );
-                    managedPlugins.put( key, element );
-                }
-
-                for ( ReportPlugin element : tgt )
-                {
-                    Object key = getReportPluginKey( element );
-                    Plugin managedPlugin = managedPlugins.get( key );
-                    if ( managedPlugin != null && element.getVersion() == null )
-                    {
-                        element.setVersion( managedPlugin.getVersion() );
-                    }
-                }
-            }
-        }
     }
 
 }

http://git-wip-us.apache.org/repos/asf/maven/blob/f34b4fbd/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
----------------------------------------------------------------------
diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
b/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
index 77219a7..a1dbb47 100644
--- a/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
+++ b/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java
@@ -316,9 +316,6 @@ public class DefaultModelValidator
 
                     validateStringNotEmpty( "reporting.plugins.plugin.groupId", problems,
Severity.ERROR, Version.V20,
                                             p.getGroupId(), p );
-
-                    validateStringNotEmpty( "reporting.plugins.plugin.version", problems,
errOn31, Version.V20, p.getVersion(),
-                                            p.getKey(), p );
                 }
             }
 

http://git-wip-us.apache.org/repos/asf/maven/blob/f34b4fbd/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java
----------------------------------------------------------------------
diff --git a/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java
b/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java
index c093804..7af3ee5 100644
--- a/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java
+++ b/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java
@@ -27,7 +27,6 @@ import org.apache.maven.model.building.DefaultModelBuildingRequest;
 import org.apache.maven.model.building.ModelBuildingRequest;
 import org.apache.maven.model.building.SimpleProblemCollector;
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
-import org.apache.maven.model.management.PluginManagementInjector;
 import org.codehaus.plexus.PlexusTestCase;
 
 /**
@@ -39,8 +38,6 @@ public class DefaultModelValidatorTest
 
     private ModelValidator validator;
 
-    private PluginManagementInjector pluginManagementInjector;
-
     private Model read( String pom )
         throws Exception
     {
@@ -74,19 +71,6 @@ public class DefaultModelValidatorTest
         return problems;
     }
 
-    private SimpleProblemCollector validateEffective( Model model )
-        throws Exception
-    {
-        ModelBuildingRequest request =
-            new DefaultModelBuildingRequest().setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_STRICT
);
-
-        SimpleProblemCollector problems = new SimpleProblemCollector( model );
-
-        validator.validateEffectiveModel( problems.getModel(), request, problems );
-
-        return problems;
-    }
-
     private SimpleProblemCollector validateRaw( String pom, int level )
         throws Exception
     {
@@ -111,14 +95,12 @@ public class DefaultModelValidatorTest
         super.setUp();
 
         validator = lookup( ModelValidator.class );
-        pluginManagementInjector = lookup( PluginManagementInjector.class );
     }
 
     @Override
     protected void tearDown()
         throws Exception
     {
-        this.pluginManagementInjector = null;
         this.validator = null;
 
         super.tearDown();
@@ -636,28 +618,6 @@ public class DefaultModelValidatorTest
     {
         SimpleProblemCollector result = validate( "missing-report-version-pom.xml" );
 
-        assertViolations( result, 0, 0, 3 );
-
-        assertContains( result.getWarnings().get( 0 ),
-                        "'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-noversion-plugin
is missing." );
-        assertContains( result.getWarnings().get( 1 ),
-                        "'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-from-plugins-plugin
is missing." );
-        assertContains( result.getWarnings().get( 2 ),
-                        "'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-from-pluginManagement-plugin
is missing." );
-
-        // after pluginManagement injection
-        ModelBuildingRequest request =
-                        new DefaultModelBuildingRequest().setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_STRICT
);
-
-        SimpleProblemCollector problems = new SimpleProblemCollector();
-
-        pluginManagementInjector.injectManagement( result.getModel(), request, problems );
-
-        result = validateEffective( result.getModel() );
-
-        assertViolations( result, 0, 0, 1 );
-
-        assertContains( result.getWarnings().get( 0 ),
-                        "'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-noversion-plugin
is missing." );
+        assertViolations( result, 0, 0, 0 );
     }
 }


Mime
View raw message