mirror of https://github.com/apache/maven.git
o Fixing license
o Prevent a NPE with a better exception. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163211 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f279ac17c2
commit
985d5c867c
|
@ -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.artifact.resolver.filter.ExclusionSetFilter;
|
|||
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.Contextualizable;
|
|||
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
|
||||
|
@ -183,6 +189,11 @@ public class DefaultPluginManager
|
|||
// 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();
|
||||
|
||||
if ( prereqs != null )
|
||||
|
|
Loading…
Reference in New Issue