mirror of https://github.com/apache/maven.git
o Fixed plugin version&prefix resolution
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@785565 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d344f6e37f
commit
114cbf2d4a
|
@ -617,8 +617,6 @@ public class DefaultLifecycleExecutor
|
|||
|
||||
injectPluginDeclarationFromProject( plugin, project );
|
||||
|
||||
if ( plugin.getVersion() == null )
|
||||
{
|
||||
// If there is no version to be found then we need to look in the repository metadata for
|
||||
// this plugin and see what's specified as the latest release.
|
||||
//
|
||||
|
@ -667,6 +665,8 @@ public class DefaultLifecycleExecutor
|
|||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -702,7 +702,6 @@ public class DefaultLifecycleExecutor
|
|||
throw new PluginNotFoundException( plugin, null );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return pluginManager.getMojoDescriptor( plugin, goal, session.getLocalRepository(), project.getPluginArtifactRepositories() );
|
||||
}
|
||||
|
@ -951,6 +950,34 @@ public class DefaultLifecycleExecutor
|
|||
return plugin;
|
||||
}
|
||||
|
||||
MavenProject project = session.getCurrentProject();
|
||||
|
||||
if ( project != null )
|
||||
{
|
||||
for ( Plugin buildPlugin : project.getBuildPlugins() )
|
||||
{
|
||||
try
|
||||
{
|
||||
PluginDescriptor pluginDescriptor =
|
||||
pluginManager.loadPlugin( buildPlugin, session.getLocalRepository(),
|
||||
project.getPluginArtifactRepositories() );
|
||||
|
||||
if ( prefix.equals( pluginDescriptor.getGoalPrefix() ) )
|
||||
{
|
||||
Plugin p = new Plugin();
|
||||
p.setGroupId( buildPlugin.getGroupId() );
|
||||
p.setArtifactId( buildPlugin.getArtifactId() );
|
||||
pluginPrefixes.put( prefix, p );
|
||||
return p;
|
||||
}
|
||||
}
|
||||
catch ( Exception e )
|
||||
{
|
||||
logger.debug( "Failed to retrieve plugin descriptor for " + buildPlugin, e );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Process all plugin groups in the local repository first to see if we get a hit. A developer may have been
|
||||
// developing a plugin locally and installing.
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue