maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tryg...@apache.org
Subject cvs commit: maven-components/maven-core/src/main/java/org/apache/maven/plugin DefaultPluginManager.java
Date Sun, 24 Oct 2004 12:16:23 GMT
trygvis     2004/10/24 05:16:23

  Modified:    maven-core/src/main/java/org/apache/maven/plugin
                        DefaultPluginManager.java
  Log:
  o Fixing license
  o Prevent a NPE with a better exception.
  
  Revision  Changes    Path
  1.14      +26 -15    maven-components/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
  
  Index: DefaultPluginManager.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- DefaultPluginManager.java	23 Oct 2004 13:37:18 -0000	1.13
  +++ DefaultPluginManager.java	24 Oct 2004 12:16:23 -0000	1.14
  @@ -1,16 +1,28 @@
   package org.apache.maven.plugin;
   
   /*
  - * Copyright 2001-2004 The Apache Software Foundation. Licensed under the Apache
  - * License, Version 2.0 (the "License"); you may not use this file except in
  - * compliance with the License. You may obtain a copy of the License at
  - * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
  - * or agreed to in writing, software distributed under the License is
  - * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  - * KIND, either express or implied. See the License for the specific language
  - * governing permissions and limitations under the License.
  + * Copyright 2001-2004 The Apache Software Foundation.
  + *
  + * Licensed under the Apache License, Version 2.0 (the "License");
  + * you may not use this file except in compliance with the License.
  + * You may obtain a copy of the License at
  + *
  + *      http://www.apache.org/licenses/LICENSE-2.0
  + *
  + * Unless required by applicable law or agreed to in writing, software
  + * distributed under the License is distributed on an "AS IS" BASIS,
  + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  + * See the License for the specific language governing permissions and
  + * limitations under the License.
    */
   
  +import java.util.HashMap;
  +import java.util.HashSet;
  +import java.util.Iterator;
  +import java.util.List;
  +import java.util.Map;
  +import java.util.Set;
  +
   import org.apache.maven.artifact.Artifact;
   import org.apache.maven.artifact.DefaultArtifact;
   import org.apache.maven.artifact.MavenMetadataSource;
  @@ -22,6 +34,7 @@
   import org.apache.maven.plugin.descriptor.MojoDescriptor;
   import org.apache.maven.plugin.descriptor.PluginDescriptor;
   import org.apache.maven.plugin.descriptor.PluginDescriptorBuilder;
  +
   import org.codehaus.plexus.ArtifactEnabledContainer;
   import org.codehaus.plexus.PlexusConstants;
   import org.codehaus.plexus.PlexusContainer;
  @@ -35,13 +48,6 @@
   import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
   import org.codehaus.plexus.util.dag.CycleDetectedException;
   
  -import java.util.HashMap;
  -import java.util.HashSet;
  -import java.util.Iterator;
  -import java.util.List;
  -import java.util.Map;
  -import java.util.Set;
  -
   public class DefaultPluginManager
       extends AbstractLogEnabled
       implements PluginManager, ComponentDiscoveryListener, Initializable, Contextualizable
  @@ -182,6 +188,11 @@
   
               // Now, we need to resolve the plugins for this goal's prereqs.
               MojoDescriptor mojoDescriptor = getMojoDescriptor( goalName );
  +
  +            if ( mojoDescriptor == null )
  +            {
  +                throw new Exception( "Could not find a mojo descriptor for goal: '" + goalName
+ "'." );
  +            }
   
               List prereqs = mojoDescriptor.getPrereqs();
   
  
  
  

Mime
View raw message