mirror of https://github.com/apache/maven.git
o update the deps to the new releases of wagon wheels and plexus
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@486535 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d846d0d8aa
commit
cc5a658907
|
@ -1,10 +1,10 @@
|
||||||
classworlds.version=1.2-alpha-5
|
classworlds.version=1.2-alpha-5
|
||||||
plexus.version=1.0-alpha-13
|
plexus.version=1.0-alpha-14
|
||||||
plexus-archiver.version=1.0-alpha-8-SNAPSHOT
|
plexus-archiver.version=1.0-alpha-8-SNAPSHOT
|
||||||
plexus-utils.version=1.2
|
plexus-utils.version=1.2
|
||||||
plexus-interactivity-api.version=1.0-alpha-4
|
plexus-interactivity-api.version=1.0-alpha-4
|
||||||
commons-cli.version=1.0
|
commons-cli.version=1.0
|
||||||
wagon.version=1.0-beta-2-SNAPSHOT
|
wagon.version=1.0-beta-2
|
||||||
doxia.version=1.0-alpha-9-SNAPSHOT
|
doxia.version=1.0-alpha-9-SNAPSHOT
|
||||||
modello.version=1.0-alpha-13
|
modello.version=1.0-alpha-13
|
||||||
junit.version=3.8.1
|
junit.version=3.8.1
|
||||||
|
|
|
@ -27,9 +27,9 @@ import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
|
||||||
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
|
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
|
||||||
import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
|
import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
|
||||||
import org.apache.maven.artifact.resolver.ArtifactResolver;
|
import org.apache.maven.artifact.resolver.ArtifactResolver;
|
||||||
|
import org.apache.maven.artifact.resolver.filter.AndArtifactFilter;
|
||||||
import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
|
import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
|
||||||
import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
|
import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
|
||||||
import org.apache.maven.artifact.resolver.filter.AndArtifactFilter;
|
|
||||||
import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
|
import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
|
||||||
import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
|
import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
|
||||||
import org.apache.maven.artifact.versioning.VersionRange;
|
import org.apache.maven.artifact.versioning.VersionRange;
|
||||||
|
@ -59,6 +59,7 @@ import org.apache.maven.settings.Settings;
|
||||||
import org.codehaus.plexus.PlexusConstants;
|
import org.codehaus.plexus.PlexusConstants;
|
||||||
import org.codehaus.plexus.PlexusContainer;
|
import org.codehaus.plexus.PlexusContainer;
|
||||||
import org.codehaus.plexus.PlexusContainerException;
|
import org.codehaus.plexus.PlexusContainerException;
|
||||||
|
import org.codehaus.plexus.classworlds.realm.ClassRealm;
|
||||||
import org.codehaus.plexus.component.configurator.ComponentConfigurationException;
|
import org.codehaus.plexus.component.configurator.ComponentConfigurationException;
|
||||||
import org.codehaus.plexus.component.configurator.ComponentConfigurator;
|
import org.codehaus.plexus.component.configurator.ComponentConfigurator;
|
||||||
import org.codehaus.plexus.component.configurator.ConfigurationListener;
|
import org.codehaus.plexus.component.configurator.ConfigurationListener;
|
||||||
|
@ -75,7 +76,6 @@ import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
|
||||||
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
|
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
|
||||||
import org.codehaus.plexus.util.StringUtils;
|
import org.codehaus.plexus.util.StringUtils;
|
||||||
import org.codehaus.plexus.util.xml.Xpp3Dom;
|
import org.codehaus.plexus.util.xml.Xpp3Dom;
|
||||||
import org.codehaus.plexus.classworlds.realm.ClassRealm;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
@ -91,9 +91,7 @@ import java.util.Set;
|
||||||
|
|
||||||
public class DefaultPluginManager
|
public class DefaultPluginManager
|
||||||
extends AbstractLogEnabled
|
extends AbstractLogEnabled
|
||||||
implements PluginManager,
|
implements PluginManager, Initializable, Contextualizable
|
||||||
Initializable,
|
|
||||||
Contextualizable
|
|
||||||
{
|
{
|
||||||
protected PlexusContainer container;
|
protected PlexusContainer container;
|
||||||
|
|
||||||
|
@ -186,7 +184,9 @@ public class DefaultPluginManager
|
||||||
VersionRange versionRange = VersionRange.createFromVersionSpec( plugin.getVersion() );
|
VersionRange versionRange = VersionRange.createFromVersionSpec( plugin.getVersion() );
|
||||||
|
|
||||||
List remoteRepositories = new ArrayList();
|
List remoteRepositories = new ArrayList();
|
||||||
|
|
||||||
remoteRepositories.addAll( project.getPluginArtifactRepositories() );
|
remoteRepositories.addAll( project.getPluginArtifactRepositories() );
|
||||||
|
|
||||||
remoteRepositories.addAll( project.getRemoteArtifactRepositories() );
|
remoteRepositories.addAll( project.getRemoteArtifactRepositories() );
|
||||||
|
|
||||||
checkRequiredMavenVersion( plugin, localRepository, remoteRepositories );
|
checkRequiredMavenVersion( plugin, localRepository, remoteRepositories );
|
||||||
|
@ -198,32 +198,19 @@ public class DefaultPluginManager
|
||||||
|
|
||||||
artifactResolver.resolve( pluginArtifact, project.getPluginArtifactRepositories(), localRepository );
|
artifactResolver.resolve( pluginArtifact, project.getPluginArtifactRepositories(), localRepository );
|
||||||
|
|
||||||
PlexusContainer pluginContainer = container.getChildContainer( plugin.getKey() );
|
if ( !pluginCollector.isPluginInstalled( plugin ) )
|
||||||
|
|
||||||
File pluginFile = pluginArtifact.getFile();
|
|
||||||
|
|
||||||
if ( !pluginCollector.isPluginInstalled( plugin ) || pluginContainer == null )
|
|
||||||
{
|
{
|
||||||
addPlugin( plugin, pluginArtifact, project, localRepository );
|
addPlugin( plugin, pluginArtifact, project, localRepository );
|
||||||
}
|
}
|
||||||
else if ( pluginFile.lastModified() > pluginContainer.getCreationDate().getTime() )
|
|
||||||
{
|
|
||||||
getLogger().info(
|
|
||||||
"Reloading plugin container for: " + plugin.getKey() + ". The plugin artifact has changed." );
|
|
||||||
|
|
||||||
pluginContainer.dispose();
|
|
||||||
|
|
||||||
pluginCollector.flushPluginDescriptor( plugin );
|
|
||||||
|
|
||||||
addPlugin( plugin, pluginArtifact, project, localRepository );
|
|
||||||
}
|
|
||||||
|
|
||||||
project.addPlugin( plugin );
|
project.addPlugin( plugin );
|
||||||
}
|
}
|
||||||
catch ( ArtifactNotFoundException e )
|
catch ( ArtifactNotFoundException e )
|
||||||
{
|
{
|
||||||
String groupId = plugin.getGroupId();
|
String groupId = plugin.getGroupId();
|
||||||
|
|
||||||
String artifactId = plugin.getArtifactId();
|
String artifactId = plugin.getArtifactId();
|
||||||
|
|
||||||
String version = plugin.getVersion();
|
String version = plugin.getVersion();
|
||||||
|
|
||||||
if ( groupId == null || artifactId == null || version == null )
|
if ( groupId == null || artifactId == null || version == null )
|
||||||
|
@ -284,6 +271,11 @@ public class DefaultPluginManager
|
||||||
ArtifactRepository localRepository )
|
ArtifactRepository localRepository )
|
||||||
throws PluginManagerException, InvalidPluginException
|
throws PluginManagerException, InvalidPluginException
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Realm creation for a plugin
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
ClassRealm componentRealm;
|
ClassRealm componentRealm;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -293,12 +285,13 @@ public class DefaultPluginManager
|
||||||
}
|
}
|
||||||
catch ( PlexusContainerException e )
|
catch ( PlexusContainerException e )
|
||||||
{
|
{
|
||||||
throw new PluginManagerException(
|
throw new PluginManagerException( "Failed to create realm for plugin '" + plugin + ".", e );
|
||||||
"Failed to create realm for plugin '" + plugin + ".", e );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// this plugin's descriptor should have been discovered in the child creation, so we should be able to
|
// ----------------------------------------------------------------------------
|
||||||
// circle around and set the artifacts and class realm
|
// The PluginCollector will now know about the plugin we are trying to load
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
PluginDescriptor pluginDescriptor = pluginCollector.getPluginDescriptor( plugin );
|
PluginDescriptor pluginDescriptor = pluginCollector.getPluginDescriptor( plugin );
|
||||||
|
|
||||||
if ( pluginDescriptor == null )
|
if ( pluginDescriptor == null )
|
||||||
|
@ -307,7 +300,6 @@ public class DefaultPluginManager
|
||||||
"The PluginDescriptor for the plugin " + plugin.getKey() + " was not found" );
|
"The PluginDescriptor for the plugin " + plugin.getKey() + " was not found" );
|
||||||
}
|
}
|
||||||
|
|
||||||
//pluginDescriptor.setClassRealm( child.getContainerRealm() );
|
|
||||||
pluginDescriptor.setClassRealm( componentRealm );
|
pluginDescriptor.setClassRealm( componentRealm );
|
||||||
|
|
||||||
// we're only setting the plugin's artifact itself as the artifact list, to allow it to be retrieved
|
// we're only setting the plugin's artifact itself as the artifact list, to allow it to be retrieved
|
||||||
|
@ -315,6 +307,10 @@ public class DefaultPluginManager
|
||||||
// transitively resolve its dependencies, and add them to the plugin container...
|
// transitively resolve its dependencies, and add them to the plugin container...
|
||||||
pluginDescriptor.setArtifacts( Collections.singletonList( pluginArtifact ) );
|
pluginDescriptor.setArtifacts( Collections.singletonList( pluginArtifact ) );
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Get the dependencies for the Plugin
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// the only Plugin instance which will have dependencies is the one specified in the project.
|
// the only Plugin instance which will have dependencies is the one specified in the project.
|
||||||
|
@ -418,7 +414,7 @@ public class DefaultPluginManager
|
||||||
|
|
||||||
// Event monitoring.
|
// Event monitoring.
|
||||||
String event = MavenEvents.MOJO_EXECUTION;
|
String event = MavenEvents.MOJO_EXECUTION;
|
||||||
|
|
||||||
EventDispatcher dispatcher = session.getEventDispatcher();
|
EventDispatcher dispatcher = session.getEventDispatcher();
|
||||||
|
|
||||||
String goalExecId = goalName;
|
String goalExecId = goalName;
|
||||||
|
@ -456,22 +452,6 @@ public class DefaultPluginManager
|
||||||
{
|
{
|
||||||
|
|
||||||
Thread.currentThread().setContextClassLoader( oldClassLoader );
|
Thread.currentThread().setContextClassLoader( oldClassLoader );
|
||||||
|
|
||||||
/*
|
|
||||||
try
|
|
||||||
{
|
|
||||||
PlexusContainer pluginContainer = getPluginContainer( mojoDescriptor.getPluginDescriptor() );
|
|
||||||
|
|
||||||
pluginContainer.release( plugin );
|
|
||||||
}
|
|
||||||
catch ( ComponentLifecycleException e )
|
|
||||||
{
|
|
||||||
if ( getLogger().isErrorEnabled() )
|
|
||||||
{
|
|
||||||
getLogger().error( "Error releasing plugin - ignoring.", e );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -520,25 +500,6 @@ public class DefaultPluginManager
|
||||||
return verifyVersionedPlugin( forLookup, project, session.getLocalRepository() );
|
return verifyVersionedPlugin( forLookup, project, session.getLocalRepository() );
|
||||||
}
|
}
|
||||||
|
|
||||||
private PlexusContainer getPluginContainer( PluginDescriptor pluginDescriptor )
|
|
||||||
throws PluginManagerException
|
|
||||||
{
|
|
||||||
return container;
|
|
||||||
|
|
||||||
/*
|
|
||||||
String pluginKey = pluginDescriptor.getPluginLookupKey();
|
|
||||||
|
|
||||||
PlexusContainer pluginContainer = container.getChildContainer( pluginKey );
|
|
||||||
|
|
||||||
if ( pluginContainer == null )
|
|
||||||
{
|
|
||||||
throw new PluginManagerException( "Cannot find Plexus container for plugin: " + pluginKey );
|
|
||||||
}
|
|
||||||
|
|
||||||
return pluginContainer;
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
private Mojo getConfiguredMojo( MavenSession session,
|
private Mojo getConfiguredMojo( MavenSession session,
|
||||||
Xpp3Dom dom,
|
Xpp3Dom dom,
|
||||||
MavenProject project,
|
MavenProject project,
|
||||||
|
@ -551,17 +512,17 @@ public class DefaultPluginManager
|
||||||
|
|
||||||
PluginDescriptor pluginDescriptor = mojoDescriptor.getPluginDescriptor();
|
PluginDescriptor pluginDescriptor = mojoDescriptor.getPluginDescriptor();
|
||||||
|
|
||||||
PlexusContainer pluginContainer = getPluginContainer( pluginDescriptor );
|
|
||||||
|
|
||||||
// if this is the first time this plugin has been used, the plugin's container will only
|
// if this is the first time this plugin has been used, the plugin's container will only
|
||||||
// contain the plugin's artifact in isolation; we need to finish resolving the plugin's
|
// contain the plugin's artifact in isolation; we need to finish resolving the plugin's
|
||||||
// dependencies, and add them to the container.
|
// dependencies, and add them to the container.
|
||||||
ensurePluginContainerIsComplete( pluginDescriptor, pluginContainer, project, session );
|
ensurePluginContainerIsComplete( pluginDescriptor, container, project, session );
|
||||||
|
|
||||||
Mojo plugin;
|
Mojo plugin;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
plugin = (Mojo) pluginContainer.lookup( Mojo.ROLE, mojoDescriptor.getRoleHint() );
|
plugin = (Mojo) container.lookup( Mojo.ROLE, mojoDescriptor.getRoleHint() );
|
||||||
|
|
||||||
if ( report && !( plugin instanceof MavenReport ) )
|
if ( report && !( plugin instanceof MavenReport ) )
|
||||||
{
|
{
|
||||||
// TODO: the mojoDescriptor should actually capture this information so we don't get this far
|
// TODO: the mojoDescriptor should actually capture this information so we don't get this far
|
||||||
|
@ -587,7 +548,9 @@ public class DefaultPluginManager
|
||||||
|
|
||||||
plugin.setLog( mojoLogger );
|
plugin.setLog( mojoLogger );
|
||||||
|
|
||||||
|
|
||||||
XmlPlexusConfiguration pomConfiguration;
|
XmlPlexusConfiguration pomConfiguration;
|
||||||
|
|
||||||
if ( dom == null )
|
if ( dom == null )
|
||||||
{
|
{
|
||||||
pomConfiguration = new XmlPlexusConfiguration( "configuration" );
|
pomConfiguration = new XmlPlexusConfiguration( "configuration" );
|
||||||
|
@ -617,8 +580,8 @@ public class DefaultPluginManager
|
||||||
|
|
||||||
checkRequiredParameters( mojoDescriptor, extractedMojoConfiguration, expressionEvaluator );
|
checkRequiredParameters( mojoDescriptor, extractedMojoConfiguration, expressionEvaluator );
|
||||||
|
|
||||||
populatePluginFields( plugin, mojoDescriptor, extractedMojoConfiguration, pluginContainer,
|
populatePluginFields( plugin, mojoDescriptor, extractedMojoConfiguration, container, expressionEvaluator );
|
||||||
expressionEvaluator );
|
|
||||||
return plugin;
|
return plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -652,7 +615,7 @@ public class DefaultPluginManager
|
||||||
|
|
||||||
Set dependencies = new HashSet( resolutionGroup.getArtifacts() );
|
Set dependencies = new HashSet( resolutionGroup.getArtifacts() );
|
||||||
dependencies.addAll( pluginDescriptor.getIntroducedDependencyArtifacts() );
|
dependencies.addAll( pluginDescriptor.getIntroducedDependencyArtifacts() );
|
||||||
|
|
||||||
List repositories = new ArrayList();
|
List repositories = new ArrayList();
|
||||||
repositories.addAll( resolutionGroup.getResolutionRepositories() );
|
repositories.addAll( resolutionGroup.getResolutionRepositories() );
|
||||||
repositories.addAll( project.getRemoteArtifactRepositories() );
|
repositories.addAll( project.getRemoteArtifactRepositories() );
|
||||||
|
@ -1099,8 +1062,11 @@ public class DefaultPluginManager
|
||||||
ConfigurationListener listener = new DebugConfigurationListener( getLogger() );
|
ConfigurationListener listener = new DebugConfigurationListener( getLogger() );
|
||||||
|
|
||||||
getLogger().debug( "Configuring mojo '" + mojoDescriptor.getId() + "' -->" );
|
getLogger().debug( "Configuring mojo '" + mojoDescriptor.getId() + "' -->" );
|
||||||
|
|
||||||
|
// This needs to be able to use methods
|
||||||
configurator.configureComponent( plugin, configuration, expressionEvaluator,
|
configurator.configureComponent( plugin, configuration, expressionEvaluator,
|
||||||
pluginContainer.getContainerRealm(), listener );
|
pluginContainer.getContainerRealm(), listener );
|
||||||
|
|
||||||
getLogger().debug( "-- end configuration --" );
|
getLogger().debug( "-- end configuration --" );
|
||||||
}
|
}
|
||||||
catch ( ComponentConfigurationException e )
|
catch ( ComponentConfigurationException e )
|
||||||
|
@ -1223,22 +1189,14 @@ public class DefaultPluginManager
|
||||||
String roleHint )
|
String roleHint )
|
||||||
throws PluginManagerException, ComponentLookupException
|
throws PluginManagerException, ComponentLookupException
|
||||||
{
|
{
|
||||||
PluginDescriptor pluginDescriptor = pluginCollector.getPluginDescriptor( plugin );
|
return container.lookup( role, roleHint );
|
||||||
|
|
||||||
PlexusContainer pluginContainer = getPluginContainer( pluginDescriptor );
|
|
||||||
|
|
||||||
return pluginContainer.lookup( role, roleHint );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map getPluginComponents( Plugin plugin,
|
public Map getPluginComponents( Plugin plugin,
|
||||||
String role )
|
String role )
|
||||||
throws ComponentLookupException, PluginManagerException
|
throws ComponentLookupException, PluginManagerException
|
||||||
{
|
{
|
||||||
PluginDescriptor pluginDescriptor = pluginCollector.getPluginDescriptor( plugin );
|
return container.lookupMap( role );
|
||||||
|
|
||||||
PlexusContainer pluginContainer = getPluginContainer( pluginDescriptor );
|
|
||||||
|
|
||||||
return pluginContainer.lookupMap( role );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addToArtifactFilter( ArtifactFilter filter )
|
public void addToArtifactFilter( ArtifactFilter filter )
|
||||||
|
|
|
@ -1242,6 +1242,7 @@ public class MavenProject
|
||||||
injectPluginManagementInfo( plugin );
|
injectPluginManagementInfo( plugin );
|
||||||
|
|
||||||
build.addPlugin( plugin );
|
build.addPlugin( plugin );
|
||||||
|
|
||||||
build.flushPluginMap();
|
build.flushPluginMap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
4
pom.xml
4
pom.xml
|
@ -146,8 +146,8 @@
|
||||||
<module>maven-tools</module>
|
<module>maven-tools</module>
|
||||||
</modules>
|
</modules>
|
||||||
<properties>
|
<properties>
|
||||||
<wagonVersion>1.0-beta-2-SNAPSHOT</wagonVersion>
|
<wagonVersion>1.0-beta-2</wagonVersion>
|
||||||
<plexusVersion>1.0-alpha-13</plexusVersion>
|
<plexusVersion>1.0-alpha-14</plexusVersion>
|
||||||
</properties>
|
</properties>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
Loading…
Reference in New Issue