mirror of https://github.com/apache/maven.git
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@750354 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0cc04bdd8a
commit
04998877df
|
@ -13,26 +13,28 @@ import java.util.Collection;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.io.StringReader;
|
import java.io.StringReader;
|
||||||
|
|
||||||
public class DefaultPluginContext implements PluginContext {
|
public class DefaultPluginContext
|
||||||
|
implements PluginContext
|
||||||
|
{
|
||||||
@Requirement
|
@Requirement
|
||||||
protected MavenPluginCollector pluginCollector;
|
protected MavenPluginCollector pluginCollector;
|
||||||
|
|
||||||
@Requirement
|
@Requirement
|
||||||
protected PluginManager pluginManager;
|
protected PluginManager pluginManager;
|
||||||
|
|
||||||
public Collection<MojoExecution> getMojoExecutionsForGoal(String goal) throws Exception
|
public Collection<MojoExecution> getMojoExecutionsForGoal( String goal )
|
||||||
|
throws Exception
|
||||||
{
|
{
|
||||||
List<MojoExecution> mojoExecutions = new ArrayList<MojoExecution>();
|
List<MojoExecution> mojoExecutions = new ArrayList<MojoExecution>();
|
||||||
|
|
||||||
for ( PluginDescriptor descriptor : pluginCollector.getPluginDescriptors() )
|
for ( PluginDescriptor descriptor : pluginCollector.getPluginDescriptors() )
|
||||||
{
|
{
|
||||||
MojoDescriptor mojoDescriptor = descriptor.getMojo( goal );
|
MojoDescriptor mojoDescriptor = descriptor.getMojo( goal );
|
||||||
|
|
||||||
if ( mojoDescriptor != null )
|
if ( mojoDescriptor != null )
|
||||||
{
|
{
|
||||||
MojoExecution mojoExecution = new MojoExecution( mojoDescriptor );
|
MojoExecution mojoExecution = new MojoExecution( mojoDescriptor );
|
||||||
mojoExecution.setConfiguration(
|
mojoExecution.setConfiguration( Xpp3DomBuilder.build( new StringReader( mojoDescriptor.getMojoConfiguration().toString() ) ) );
|
||||||
Xpp3DomBuilder.build( new StringReader( mojoDescriptor.getMojoConfiguration().toString() ) ) );
|
|
||||||
mojoExecutions.add( mojoExecution );
|
mojoExecutions.add( mojoExecution );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,15 +42,18 @@ public class DefaultPluginContext implements PluginContext {
|
||||||
return mojoExecutions;
|
return mojoExecutions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object getMojoParameterFor(MojoExecution mojoExecution, String xPath) throws Exception {
|
public Object getMojoParameterFor( MojoExecution mojoExecution, String xPath )
|
||||||
Xpp3Dom mojoDescriptorConfiguration =
|
throws Exception
|
||||||
Xpp3DomBuilder.build( new StringReader(mojoExecution.getMojoDescriptor().getMojoConfiguration().toString()));
|
{
|
||||||
|
Xpp3Dom mojoDescriptorConfiguration = Xpp3DomBuilder.build( new StringReader( mojoExecution.getMojoDescriptor().getMojoConfiguration().toString() ) );
|
||||||
|
|
||||||
Xpp3Dom mergedConfig = Xpp3Dom.mergeXpp3Dom( mojoExecution.getConfiguration(), mojoDescriptorConfiguration );
|
Xpp3Dom mergedConfig = Xpp3Dom.mergeXpp3Dom( mojoExecution.getConfiguration(), mojoDescriptorConfiguration );
|
||||||
|
|
||||||
return JXPathContext.newContext( mergedConfig ).getValue( xPath );
|
return JXPathContext.newContext( mergedConfig ).getValue( xPath );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void executeMojo( MojoExecution mojoExecution, MavenSession session ) throws Exception
|
public void executeMojo( MojoExecution mojoExecution, MavenSession session )
|
||||||
|
throws Exception
|
||||||
{
|
{
|
||||||
pluginManager.executeMojo( session.getCurrentProject(), mojoExecution, session );
|
pluginManager.executeMojo( session.getCurrentProject(), mojoExecution, session );
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@ import org.apache.maven.artifact.repository.metadata.RepositoryMetadataResolutio
|
||||||
import org.codehaus.plexus.component.annotations.Component;
|
import org.codehaus.plexus.component.annotations.Component;
|
||||||
import org.codehaus.plexus.component.annotations.Requirement;
|
import org.codehaus.plexus.component.annotations.Requirement;
|
||||||
import org.codehaus.plexus.logging.AbstractLogEnabled;
|
import org.codehaus.plexus.logging.AbstractLogEnabled;
|
||||||
|
import org.codehaus.plexus.logging.Logger;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -44,9 +45,11 @@ import java.util.Map;
|
||||||
*/
|
*/
|
||||||
@Component(role = PluginMappingManager.class)
|
@Component(role = PluginMappingManager.class)
|
||||||
public class DefaultPluginMappingManager
|
public class DefaultPluginMappingManager
|
||||||
extends AbstractLogEnabled
|
|
||||||
implements PluginMappingManager
|
implements PluginMappingManager
|
||||||
{
|
{
|
||||||
|
@Requirement
|
||||||
|
private Logger logger;
|
||||||
|
|
||||||
@Requirement
|
@Requirement
|
||||||
protected RepositoryMetadataManager repositoryMetadataManager;
|
protected RepositoryMetadataManager repositoryMetadataManager;
|
||||||
|
|
||||||
|
@ -58,7 +61,7 @@ public class DefaultPluginMappingManager
|
||||||
// if not found, try from the remote repository
|
// if not found, try from the remote repository
|
||||||
if ( !pluginDefinitionsByPrefix.containsKey( pluginPrefix ) )
|
if ( !pluginDefinitionsByPrefix.containsKey( pluginPrefix ) )
|
||||||
{
|
{
|
||||||
getLogger().info( "Searching repository for plugin with prefix: \'" + pluginPrefix + "\'." );
|
logger.info( "Searching repository for plugin with prefix: \'" + pluginPrefix + "\'." );
|
||||||
|
|
||||||
loadPluginMappings( groupIds, pluginRepositories, localRepository );
|
loadPluginMappings( groupIds, pluginRepositories, localRepository );
|
||||||
}
|
}
|
||||||
|
@ -67,7 +70,7 @@ public class DefaultPluginMappingManager
|
||||||
|
|
||||||
if ( result == null )
|
if ( result == null )
|
||||||
{
|
{
|
||||||
getLogger().debug( "Failed to resolve plugin from prefix: " + pluginPrefix, new Throwable() );
|
logger.debug( "Failed to resolve plugin from prefix: " + pluginPrefix, new Throwable() );
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -90,16 +93,16 @@ public class DefaultPluginMappingManager
|
||||||
for ( Iterator it = pluginGroupIds.iterator(); it.hasNext(); )
|
for ( Iterator it = pluginGroupIds.iterator(); it.hasNext(); )
|
||||||
{
|
{
|
||||||
String groupId = (String) it.next();
|
String groupId = (String) it.next();
|
||||||
getLogger().debug( "Loading plugin prefixes from group: " + groupId );
|
logger.debug( "Loading plugin prefixes from group: " + groupId );
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
loadPluginMappings( groupId, pluginRepositories, localRepository );
|
loadPluginMappings( groupId, pluginRepositories, localRepository );
|
||||||
}
|
}
|
||||||
catch ( RepositoryMetadataResolutionException e )
|
catch ( RepositoryMetadataResolutionException e )
|
||||||
{
|
{
|
||||||
getLogger().warn( "Cannot resolve plugin-mapping metadata for groupId: " + groupId + " - IGNORING." );
|
logger.warn( "Cannot resolve plugin-mapping metadata for groupId: " + groupId + " - IGNORING." );
|
||||||
|
|
||||||
getLogger().debug( "Error resolving plugin-mapping metadata for groupId: " + groupId + ".", e );
|
logger.debug( "Error resolving plugin-mapping metadata for groupId: " + groupId + ".", e );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -109,7 +112,7 @@ public class DefaultPluginMappingManager
|
||||||
{
|
{
|
||||||
RepositoryMetadata metadata = new GroupRepositoryMetadata( groupId );
|
RepositoryMetadata metadata = new GroupRepositoryMetadata( groupId );
|
||||||
|
|
||||||
getLogger().debug( "Checking repositories:\n" + pluginRepositories + "\n\nfor plugin prefix metadata: " + groupId );
|
logger.debug( "Checking repositories:\n" + pluginRepositories + "\n\nfor plugin prefix metadata: " + groupId );
|
||||||
repositoryMetadataManager.resolve( metadata, pluginRepositories, localRepository );
|
repositoryMetadataManager.resolve( metadata, pluginRepositories, localRepository );
|
||||||
|
|
||||||
Metadata repoMetadata = metadata.getMetadata();
|
Metadata repoMetadata = metadata.getMetadata();
|
||||||
|
@ -118,7 +121,7 @@ public class DefaultPluginMappingManager
|
||||||
for ( Iterator pluginIterator = repoMetadata.getPlugins().iterator(); pluginIterator.hasNext(); )
|
for ( Iterator pluginIterator = repoMetadata.getPlugins().iterator(); pluginIterator.hasNext(); )
|
||||||
{
|
{
|
||||||
Plugin mapping = (Plugin) pluginIterator.next();
|
Plugin mapping = (Plugin) pluginIterator.next();
|
||||||
getLogger().debug( "Found plugin: " + mapping.getName() + " with prefix: " + mapping.getPrefix() );
|
logger.debug( "Found plugin: " + mapping.getName() + " with prefix: " + mapping.getPrefix() );
|
||||||
|
|
||||||
String prefix = mapping.getPrefix();
|
String prefix = mapping.getPrefix();
|
||||||
|
|
||||||
|
|
|
@ -126,10 +126,7 @@ public class DefaultPluginVersionManager
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getVersionFromPluginConfig( String groupId,
|
private String getVersionFromPluginConfig( String groupId, String artifactId, MavenProject project, boolean resolveAsReportPlugin )
|
||||||
String artifactId,
|
|
||||||
MavenProject project,
|
|
||||||
boolean resolveAsReportPlugin )
|
|
||||||
{
|
{
|
||||||
String version = null;
|
String version = null;
|
||||||
|
|
||||||
|
|
|
@ -19,29 +19,35 @@ package org.apache.maven.plugin;
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import org.apache.maven.artifact.ArtifactUtils;
|
import org.apache.maven.artifact.ArtifactUtils;
|
||||||
import org.apache.maven.model.Plugin;
|
import org.apache.maven.model.Plugin;
|
||||||
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
||||||
|
import org.codehaus.plexus.component.annotations.Requirement;
|
||||||
import org.codehaus.plexus.component.discovery.ComponentDiscoveryEvent;
|
import org.codehaus.plexus.component.discovery.ComponentDiscoveryEvent;
|
||||||
import org.codehaus.plexus.component.discovery.ComponentDiscoveryListener;
|
import org.codehaus.plexus.component.discovery.ComponentDiscoveryListener;
|
||||||
import org.codehaus.plexus.component.repository.ComponentSetDescriptor;
|
import org.codehaus.plexus.component.repository.ComponentSetDescriptor;
|
||||||
import org.codehaus.plexus.logging.LogEnabled;
|
|
||||||
import org.codehaus.plexus.logging.Logger;
|
import org.codehaus.plexus.logging.Logger;
|
||||||
import org.codehaus.plexus.logging.console.ConsoleLogger;
|
import org.codehaus.plexus.logging.console.ConsoleLogger;
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
public class MavenPluginCollector
|
public class MavenPluginCollector
|
||||||
implements ComponentDiscoveryListener, LogEnabled
|
implements ComponentDiscoveryListener
|
||||||
{
|
{
|
||||||
|
@Requirement
|
||||||
|
private Logger logger;
|
||||||
|
|
||||||
private Set pluginsInProcess = new HashSet();
|
private Set pluginsInProcess = new HashSet();
|
||||||
|
|
||||||
private Map<String, PluginDescriptor> pluginDescriptors = new HashMap();
|
private Map<String, PluginDescriptor> pluginDescriptors = new HashMap();
|
||||||
|
|
||||||
private Map pluginIdsByPrefix = new HashMap();
|
private Map pluginIdsByPrefix = new HashMap();
|
||||||
|
|
||||||
private Logger logger;
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
// Mojo discovery
|
// Mojo discovery
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
|
|
@ -35,39 +35,28 @@ public class PluginConfigurationException
|
||||||
|
|
||||||
private String originalMessage;
|
private String originalMessage;
|
||||||
|
|
||||||
public PluginConfigurationException(
|
public PluginConfigurationException( PluginDescriptor pluginDescriptor, String originalMessage )
|
||||||
PluginDescriptor pluginDescriptor,
|
|
||||||
String originalMessage )
|
|
||||||
{
|
{
|
||||||
super( originalMessage );
|
super( originalMessage );
|
||||||
this.pluginDescriptor = pluginDescriptor;
|
this.pluginDescriptor = pluginDescriptor;
|
||||||
this.originalMessage = originalMessage;
|
this.originalMessage = originalMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PluginConfigurationException(
|
public PluginConfigurationException( PluginDescriptor pluginDescriptor, String originalMessage, ExpressionEvaluationException cause )
|
||||||
PluginDescriptor pluginDescriptor,
|
|
||||||
String originalMessage,
|
|
||||||
ExpressionEvaluationException cause )
|
|
||||||
{
|
{
|
||||||
super( cause );
|
super( cause );
|
||||||
this.pluginDescriptor = pluginDescriptor;
|
this.pluginDescriptor = pluginDescriptor;
|
||||||
this.originalMessage = originalMessage;
|
this.originalMessage = originalMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PluginConfigurationException(
|
public PluginConfigurationException( PluginDescriptor pluginDescriptor, String originalMessage, ComponentConfigurationException cause )
|
||||||
PluginDescriptor pluginDescriptor,
|
|
||||||
String originalMessage,
|
|
||||||
ComponentConfigurationException cause )
|
|
||||||
{
|
{
|
||||||
super( cause );
|
super( cause );
|
||||||
this.pluginDescriptor = pluginDescriptor;
|
this.pluginDescriptor = pluginDescriptor;
|
||||||
this.originalMessage = originalMessage;
|
this.originalMessage = originalMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PluginConfigurationException(
|
public PluginConfigurationException( PluginDescriptor pluginDescriptor, String originalMessage, ComponentLookupException cause )
|
||||||
PluginDescriptor pluginDescriptor,
|
|
||||||
String originalMessage,
|
|
||||||
ComponentLookupException cause )
|
|
||||||
{
|
{
|
||||||
super( cause );
|
super( cause );
|
||||||
this.pluginDescriptor = pluginDescriptor;
|
this.pluginDescriptor = pluginDescriptor;
|
||||||
|
|
|
@ -24,39 +24,28 @@ public class PluginContainerException
|
||||||
|
|
||||||
private ClassRealm pluginRealm;
|
private ClassRealm pluginRealm;
|
||||||
|
|
||||||
public PluginContainerException( MojoDescriptor mojoDescriptor,
|
public PluginContainerException( MojoDescriptor mojoDescriptor, ClassRealm pluginRealm, String message, ComponentLookupException e )
|
||||||
ClassRealm pluginRealm,
|
|
||||||
String message,
|
|
||||||
ComponentLookupException e )
|
|
||||||
{
|
{
|
||||||
super( mojoDescriptor, message, e );
|
super( mojoDescriptor, message, e );
|
||||||
|
|
||||||
this.pluginRealm = pluginRealm;
|
this.pluginRealm = pluginRealm;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PluginContainerException( Plugin plugin,
|
public PluginContainerException( Plugin plugin, ClassRealm pluginRealm, String message, PlexusConfigurationException e )
|
||||||
ClassRealm pluginRealm,
|
|
||||||
String message,
|
|
||||||
PlexusConfigurationException e )
|
|
||||||
{
|
{
|
||||||
super( plugin, message, e );
|
super( plugin, message, e );
|
||||||
|
|
||||||
this.pluginRealm = pluginRealm;
|
this.pluginRealm = pluginRealm;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PluginContainerException( Plugin plugin,
|
public PluginContainerException( Plugin plugin, ClassRealm pluginRealm, String message, ComponentRepositoryException e )
|
||||||
ClassRealm pluginRealm,
|
|
||||||
String message,
|
|
||||||
ComponentRepositoryException e )
|
|
||||||
{
|
{
|
||||||
super( plugin, message, e );
|
super( plugin, message, e );
|
||||||
|
|
||||||
this.pluginRealm = pluginRealm;
|
this.pluginRealm = pluginRealm;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PluginContainerException( Plugin plugin,
|
public PluginContainerException( Plugin plugin, String message, RealmManagementException e )
|
||||||
String message,
|
|
||||||
RealmManagementException e )
|
|
||||||
{
|
{
|
||||||
super( plugin, message, e );
|
super( plugin, message, e );
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,5 +11,4 @@ public interface PluginContext {
|
||||||
Object getMojoParameterFor(MojoExecution mojoExecution, String xPath) throws Exception;
|
Object getMojoParameterFor(MojoExecution mojoExecution, String xPath) throws Exception;
|
||||||
|
|
||||||
void executeMojo(MojoExecution mojoExecution, MavenSession session) throws Exception;
|
void executeMojo(MojoExecution mojoExecution, MavenSession session) throws Exception;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,25 +9,19 @@ public class PluginExecutionException
|
||||||
|
|
||||||
private final MojoExecution mojoExecution;
|
private final MojoExecution mojoExecution;
|
||||||
|
|
||||||
public PluginExecutionException( MojoExecution mojoExecution,
|
public PluginExecutionException( MojoExecution mojoExecution, MavenProject project, String message )
|
||||||
MavenProject project,
|
|
||||||
String message )
|
|
||||||
{
|
{
|
||||||
super( mojoExecution.getMojoDescriptor(), project, message );
|
super( mojoExecution.getMojoDescriptor(), project, message );
|
||||||
this.mojoExecution = mojoExecution;
|
this.mojoExecution = mojoExecution;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PluginExecutionException( MojoExecution mojoExecution,
|
public PluginExecutionException( MojoExecution mojoExecution, MavenProject project, MojoExecutionException cause )
|
||||||
MavenProject project,
|
|
||||||
MojoExecutionException cause )
|
|
||||||
{
|
{
|
||||||
super( mojoExecution.getMojoDescriptor(), project, "Mojo execution failed.", cause );
|
super( mojoExecution.getMojoDescriptor(), project, "Mojo execution failed.", cause );
|
||||||
this.mojoExecution = mojoExecution;
|
this.mojoExecution = mojoExecution;
|
||||||
}
|
}
|
||||||
|
|
||||||
public PluginExecutionException( MojoExecution mojoExecution,
|
public PluginExecutionException( MojoExecution mojoExecution, MavenProject project, DuplicateArtifactAttachmentException cause )
|
||||||
MavenProject project,
|
|
||||||
DuplicateArtifactAttachmentException cause )
|
|
||||||
{
|
{
|
||||||
super( mojoExecution.getMojoDescriptor(), project, "Mojo execution failed.", cause );
|
super( mojoExecution.getMojoDescriptor(), project, "Mojo execution failed.", cause );
|
||||||
this.mojoExecution = mojoExecution;
|
this.mojoExecution = mojoExecution;
|
||||||
|
@ -37,5 +31,4 @@ public class PluginExecutionException
|
||||||
{
|
{
|
||||||
return mojoExecution;
|
return mojoExecution;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,36 +35,18 @@ import org.apache.maven.reporting.MavenReport;
|
||||||
*/
|
*/
|
||||||
public interface PluginManager
|
public interface PluginManager
|
||||||
{
|
{
|
||||||
String ROLE = PluginManager.class.getName();
|
void executeMojo( MavenProject project, MojoExecution execution, MavenSession session )
|
||||||
|
throws ArtifactResolutionException, MojoFailureException, ArtifactNotFoundException, InvalidDependencyVersionException, PluginManagerException, PluginConfigurationException;
|
||||||
|
|
||||||
void executeMojo( MavenProject project,
|
MavenReport getReport( MavenProject project, MojoExecution mojoExecution, MavenSession session )
|
||||||
MojoExecution execution,
|
throws ArtifactNotFoundException, PluginConfigurationException, PluginManagerException, ArtifactResolutionException;
|
||||||
MavenSession session )
|
|
||||||
throws ArtifactResolutionException, MojoFailureException, ArtifactNotFoundException,
|
|
||||||
InvalidDependencyVersionException, PluginManagerException, PluginConfigurationException;
|
|
||||||
|
|
||||||
MavenReport getReport( MavenProject project,
|
Plugin getPluginDefinitionForPrefix( String prefix, MavenSession session, MavenProject project );
|
||||||
MojoExecution mojoExecution,
|
|
||||||
MavenSession session )
|
|
||||||
throws ArtifactNotFoundException, PluginConfigurationException, PluginManagerException,
|
|
||||||
ArtifactResolutionException;
|
|
||||||
|
|
||||||
Plugin getPluginDefinitionForPrefix( String prefix,
|
PluginDescriptor verifyPlugin( Plugin plugin, MavenProject project, MavenSession session )
|
||||||
MavenSession session,
|
throws ArtifactResolutionException, PluginVersionResolutionException, ArtifactNotFoundException, InvalidPluginException, PluginManagerException, PluginNotFoundException, PluginVersionNotFoundException;
|
||||||
MavenProject project );
|
|
||||||
|
|
||||||
PluginDescriptor verifyPlugin( Plugin plugin,
|
PluginDescriptor verifyReportPlugin( ReportPlugin reportPlugin, MavenProject project, MavenSession session )
|
||||||
MavenProject project,
|
throws PluginVersionResolutionException, ArtifactResolutionException, ArtifactNotFoundException, InvalidPluginException, PluginManagerException, PluginNotFoundException, PluginVersionNotFoundException;
|
||||||
MavenSession session )
|
|
||||||
throws ArtifactResolutionException, PluginVersionResolutionException, ArtifactNotFoundException,
|
|
||||||
InvalidPluginException, PluginManagerException, PluginNotFoundException,
|
|
||||||
PluginVersionNotFoundException;
|
|
||||||
|
|
||||||
PluginDescriptor verifyReportPlugin( ReportPlugin reportPlugin,
|
|
||||||
MavenProject project,
|
|
||||||
MavenSession session )
|
|
||||||
throws PluginVersionResolutionException, ArtifactResolutionException, ArtifactNotFoundException,
|
|
||||||
InvalidPluginException, PluginManagerException, PluginNotFoundException,
|
|
||||||
PluginVersionNotFoundException;
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -50,10 +50,7 @@ public class PluginManagerException
|
||||||
|
|
||||||
private MavenProject project;
|
private MavenProject project;
|
||||||
|
|
||||||
protected PluginManagerException( Plugin plugin,
|
protected PluginManagerException( Plugin plugin, String message, MavenProject project, Throwable cause )
|
||||||
String message,
|
|
||||||
MavenProject project,
|
|
||||||
Throwable cause )
|
|
||||||
{
|
{
|
||||||
super( message, cause );
|
super( message, cause );
|
||||||
|
|
||||||
|
@ -63,9 +60,7 @@ public class PluginManagerException
|
||||||
pluginVersion = plugin.getVersion();
|
pluginVersion = plugin.getVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected PluginManagerException( Plugin plugin,
|
protected PluginManagerException( Plugin plugin, String message, Throwable cause )
|
||||||
String message,
|
|
||||||
Throwable cause )
|
|
||||||
{
|
{
|
||||||
super( message, cause );
|
super( message, cause );
|
||||||
|
|
||||||
|
@ -74,9 +69,7 @@ public class PluginManagerException
|
||||||
pluginVersion = plugin.getVersion();
|
pluginVersion = plugin.getVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected PluginManagerException( MojoDescriptor mojoDescriptor,
|
protected PluginManagerException( MojoDescriptor mojoDescriptor, String message, Throwable cause )
|
||||||
String message,
|
|
||||||
Throwable cause )
|
|
||||||
{
|
{
|
||||||
super( message, cause );
|
super( message, cause );
|
||||||
pluginGroupId = mojoDescriptor.getPluginDescriptor().getGroupId();
|
pluginGroupId = mojoDescriptor.getPluginDescriptor().getGroupId();
|
||||||
|
@ -85,9 +78,7 @@ public class PluginManagerException
|
||||||
goal = mojoDescriptor.getGoal();
|
goal = mojoDescriptor.getGoal();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected PluginManagerException( MojoDescriptor mojoDescriptor,
|
protected PluginManagerException( MojoDescriptor mojoDescriptor, MavenProject project, String message )
|
||||||
MavenProject project,
|
|
||||||
String message )
|
|
||||||
{
|
{
|
||||||
super( message );
|
super( message );
|
||||||
this.project = project;
|
this.project = project;
|
||||||
|
@ -97,10 +88,7 @@ public class PluginManagerException
|
||||||
goal = mojoDescriptor.getGoal();
|
goal = mojoDescriptor.getGoal();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected PluginManagerException( MojoDescriptor mojoDescriptor,
|
protected PluginManagerException( MojoDescriptor mojoDescriptor, MavenProject project, String message, Throwable cause )
|
||||||
MavenProject project,
|
|
||||||
String message,
|
|
||||||
Throwable cause )
|
|
||||||
{
|
{
|
||||||
super( message, cause );
|
super( message, cause );
|
||||||
this.project = project;
|
this.project = project;
|
||||||
|
@ -110,8 +98,7 @@ public class PluginManagerException
|
||||||
goal = mojoDescriptor.getGoal();
|
goal = mojoDescriptor.getGoal();
|
||||||
}
|
}
|
||||||
|
|
||||||
public PluginManagerException( Plugin plugin,
|
public PluginManagerException( Plugin plugin, InvalidVersionSpecificationException cause )
|
||||||
InvalidVersionSpecificationException cause )
|
|
||||||
{
|
{
|
||||||
super( cause );
|
super( cause );
|
||||||
|
|
||||||
|
@ -120,9 +107,7 @@ public class PluginManagerException
|
||||||
pluginVersion = plugin.getVersion();
|
pluginVersion = plugin.getVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
public PluginManagerException( Plugin plugin,
|
public PluginManagerException( Plugin plugin, String message, PlexusConfigurationException cause )
|
||||||
String message,
|
|
||||||
PlexusConfigurationException cause )
|
|
||||||
{
|
{
|
||||||
super( message, cause );
|
super( message, cause );
|
||||||
|
|
||||||
|
@ -131,9 +116,7 @@ public class PluginManagerException
|
||||||
pluginVersion = plugin.getVersion();
|
pluginVersion = plugin.getVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
public PluginManagerException( Plugin plugin,
|
public PluginManagerException( Plugin plugin, String message, ComponentRepositoryException cause )
|
||||||
String message,
|
|
||||||
ComponentRepositoryException cause )
|
|
||||||
{
|
{
|
||||||
super( message, cause );
|
super( message, cause );
|
||||||
|
|
||||||
|
@ -142,10 +125,7 @@ public class PluginManagerException
|
||||||
pluginVersion = plugin.getVersion();
|
pluginVersion = plugin.getVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
public PluginManagerException( MojoDescriptor mojoDescriptor,
|
public PluginManagerException( MojoDescriptor mojoDescriptor, MavenProject project, String message, NoSuchRealmException cause )
|
||||||
MavenProject project,
|
|
||||||
String message,
|
|
||||||
NoSuchRealmException cause )
|
|
||||||
{
|
{
|
||||||
super( message, cause );
|
super( message, cause );
|
||||||
|
|
||||||
|
@ -156,10 +136,7 @@ public class PluginManagerException
|
||||||
goal = mojoDescriptor.getGoal();
|
goal = mojoDescriptor.getGoal();
|
||||||
}
|
}
|
||||||
|
|
||||||
public PluginManagerException( MojoDescriptor mojoDescriptor,
|
public PluginManagerException( MojoDescriptor mojoDescriptor, String message, MavenProject project, PlexusContainerException cause )
|
||||||
String message,
|
|
||||||
MavenProject project,
|
|
||||||
PlexusContainerException cause )
|
|
||||||
{
|
{
|
||||||
super( message, cause );
|
super( message, cause );
|
||||||
|
|
||||||
|
@ -173,9 +150,7 @@ public class PluginManagerException
|
||||||
goal = mojoDescriptor.getGoal();
|
goal = mojoDescriptor.getGoal();
|
||||||
}
|
}
|
||||||
|
|
||||||
public PluginManagerException( Plugin plugin,
|
public PluginManagerException( Plugin plugin, String message, PlexusContainerException cause )
|
||||||
String message,
|
|
||||||
PlexusContainerException cause )
|
|
||||||
{
|
{
|
||||||
super( message, cause );
|
super( message, cause );
|
||||||
|
|
||||||
|
@ -184,9 +159,7 @@ public class PluginManagerException
|
||||||
pluginVersion = plugin.getVersion();
|
pluginVersion = plugin.getVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
public PluginManagerException( Plugin plugin,
|
public PluginManagerException( Plugin plugin, String message, RealmManagementException cause )
|
||||||
String message,
|
|
||||||
RealmManagementException cause )
|
|
||||||
{
|
{
|
||||||
super( message, cause );
|
super( message, cause );
|
||||||
|
|
||||||
|
@ -195,9 +168,7 @@ public class PluginManagerException
|
||||||
pluginVersion = plugin.getVersion();
|
pluginVersion = plugin.getVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
public PluginManagerException( Plugin plugin,
|
public PluginManagerException( Plugin plugin, String message, MavenProject project )
|
||||||
String message,
|
|
||||||
MavenProject project )
|
|
||||||
{
|
{
|
||||||
super( message );
|
super( message );
|
||||||
|
|
||||||
|
|
|
@ -14,15 +14,10 @@ import java.util.List;
|
||||||
public interface PluginManagerSupport
|
public interface PluginManagerSupport
|
||||||
{
|
{
|
||||||
|
|
||||||
Artifact resolvePluginArtifact( Plugin plugin,
|
Artifact resolvePluginArtifact( Plugin plugin, MavenProject project, MavenSession session )
|
||||||
MavenProject project,
|
throws PluginManagerException, InvalidPluginException, PluginVersionResolutionException, ArtifactResolutionException, ArtifactNotFoundException;
|
||||||
MavenSession session )
|
|
||||||
throws PluginManagerException, InvalidPluginException, PluginVersionResolutionException,
|
|
||||||
ArtifactResolutionException, ArtifactNotFoundException;
|
|
||||||
|
|
||||||
MavenProject buildPluginProject( Plugin plugin,
|
MavenProject buildPluginProject( Plugin plugin, ArtifactRepository localRepository, List remoteRepositories )
|
||||||
ArtifactRepository localRepository,
|
|
||||||
List remoteRepositories )
|
|
||||||
throws InvalidPluginException;
|
throws InvalidPluginException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,18 +25,11 @@ public interface PluginManagerSupport
|
||||||
* @todo would be better to store this in the plugin descriptor, but then it won't be available to the version
|
* @todo would be better to store this in the plugin descriptor, but then it won't be available to the version
|
||||||
* manager which executes before the plugin is instantiated
|
* manager which executes before the plugin is instantiated
|
||||||
*/
|
*/
|
||||||
void checkRequiredMavenVersion( Plugin plugin,
|
void checkRequiredMavenVersion( Plugin plugin, MavenProject pluginProject, ArtifactRepository localRepository, List remoteRepositories )
|
||||||
MavenProject pluginProject,
|
|
||||||
ArtifactRepository localRepository,
|
|
||||||
List remoteRepositories )
|
|
||||||
throws PluginVersionResolutionException, InvalidPluginException;
|
throws PluginVersionResolutionException, InvalidPluginException;
|
||||||
|
|
||||||
void checkPluginDependencySpec( Plugin plugin,
|
void checkPluginDependencySpec( Plugin plugin, MavenProject pluginProject )
|
||||||
MavenProject pluginProject )
|
|
||||||
throws InvalidPluginException;
|
throws InvalidPluginException;
|
||||||
|
|
||||||
PluginDescriptor loadIsolatedPluginDescriptor( Plugin plugin,
|
PluginDescriptor loadIsolatedPluginDescriptor( Plugin plugin, MavenProject project, MavenSession session );
|
||||||
MavenProject project,
|
|
||||||
MavenSession session );
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,5 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface PluginMappingManager
|
public interface PluginMappingManager
|
||||||
{
|
{
|
||||||
Plugin getByPrefix( String pluginPrefix, List groupIds, List pluginRepositories,
|
Plugin getByPrefix( String pluginPrefix, List groupIds, List pluginRepositories, ArtifactRepository localRepository );
|
||||||
ArtifactRepository localRepository );
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,6 @@ package org.apache.maven.plugin;
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
|
||||||
import org.apache.maven.execution.MavenSession;
|
import org.apache.maven.execution.MavenSession;
|
||||||
import org.apache.maven.project.MavenProject;
|
import org.apache.maven.project.MavenProject;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue