maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r800315 - in /maven/components/trunk/maven-core/src/main/java/org/apache/maven: lifecycle/DefaultLifecycleExecutor.java lifecycle/LifecycleExecutor.java model/plugin/DefaultLifecycleBindingsInjector.java
Date Mon, 03 Aug 2009 11:41:34 GMT
Author: bentmann
Date: Mon Aug  3 11:41:33 2009
New Revision: 800315

URL: http://svn.apache.org/viewvc?rev=800315&view=rev
Log:
o Updated API to detect unknown/bad packagings

Modified:
    maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
    maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutor.java
    maven/components/trunk/maven-core/src/main/java/org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector.java

Modified: maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java?rev=800315&r1=800314&r2=800315&view=diff
==============================================================================
--- maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
(original)
+++ maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
Mon Aug  3 11:41:33 2009
@@ -1025,17 +1025,19 @@
     //
     public Set<Plugin> getPluginsBoundByDefaultToAllLifecycles( String packaging )
     {
+        LifecycleMapping lifecycleMappingForPackaging = lifecycleMappings.get( packaging
);
+
+        if ( lifecycleMappingForPackaging == null )
+        {
+            return null;
+        }
+
         Map<Plugin, Plugin> plugins = new LinkedHashMap<Plugin, Plugin>();
-        
+
         for ( Lifecycle lifecycle : lifecycles )
         {
-            LifecycleMapping lifecycleMappingForPackaging = lifecycleMappings.get( packaging
);
-
-            org.apache.maven.lifecycle.mapping.Lifecycle lifecycleConfiguration = null;
-            if ( lifecycleMappingForPackaging != null )
-            {
-                lifecycleConfiguration = lifecycleMappingForPackaging.getLifecycles().get(
lifecycle.getId() );
-            }
+            org.apache.maven.lifecycle.mapping.Lifecycle lifecycleConfiguration =
+                lifecycleMappingForPackaging.getLifecycles().get( lifecycle.getId() );
 
             if ( lifecycleConfiguration != null )
             {

Modified: maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutor.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutor.java?rev=800315&r1=800314&r2=800315&view=diff
==============================================================================
--- maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutor.java
(original)
+++ maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/LifecycleExecutor.java
Mon Aug  3 11:41:33 2009
@@ -63,6 +63,10 @@
     // We need to know the specific version so that we can lookup the right version of the
plugin descriptor
     // which tells us what the default configuration is.
     //
+    /**
+     * @return The plugins bound to the lifecycles of the specified packaging or {@code null}
if the packaging is
+     *         unknown.
+     */
     Set<Plugin> getPluginsBoundByDefaultToAllLifecycles( String packaging );
 
     // Given a set of {@link org.apache.maven.Plugin} objects where the GAV is set we can
lookup the plugin

Modified: maven/components/trunk/maven-core/src/main/java/org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-core/src/main/java/org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector.java?rev=800315&r1=800314&r2=800315&view=diff
==============================================================================
--- maven/components/trunk/maven-core/src/main/java/org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector.java
(original)
+++ maven/components/trunk/maven-core/src/main/java/org/apache/maven/model/plugin/DefaultLifecycleBindingsInjector.java
Mon Aug  3 11:41:33 2009
@@ -57,7 +57,9 @@
 
         Collection<Plugin> defaultPlugins = lifecycle.getPluginsBoundByDefaultToAllLifecycles(
packaging );
 
-        if ( !defaultPlugins.isEmpty() )
+        // TODO: A bad packaging is a model error, we need to report this as such!
+
+        if ( defaultPlugins != null && !defaultPlugins.isEmpty() )
         {
             Model lifecycleModel = new Model();
             lifecycleModel.setBuild( new Build() );



Mime
View raw message