Adding back the extension manager support for injected containers into the WagonManager.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@507294 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Joakim Erdfelt 2007-02-13 23:14:14 +00:00
parent fa2051759e
commit 36eced2a73
5 changed files with 37 additions and 1 deletions

View File

@ -94,6 +94,8 @@ public class DefaultBuildExtensionScanner
} }
getLogger().debug( "Finished pre-scanning: " + pom + " for build extensions." ); getLogger().debug( "Finished pre-scanning: " + pom + " for build extensions." );
extensionManager.registerWagons();
} }
catch ( ModelInterpolationException e ) catch ( ModelInterpolationException e )
{ {

View File

@ -31,9 +31,11 @@ import org.apache.maven.model.Extension;
import org.apache.maven.model.Model; import org.apache.maven.model.Model;
import org.apache.maven.model.Parent; import org.apache.maven.model.Parent;
import org.apache.maven.project.MavenProject; import org.apache.maven.project.MavenProject;
import org.apache.maven.wagon.manager.WagonManager;
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.component.repository.exception.ComponentLookupException;
import org.codehaus.plexus.context.Context; import org.codehaus.plexus.context.Context;
import org.codehaus.plexus.context.ContextException; import org.codehaus.plexus.context.ContextException;
import org.codehaus.plexus.logging.AbstractLogEnabled; import org.codehaus.plexus.logging.AbstractLogEnabled;
@ -64,6 +66,8 @@ public class DefaultExtensionManager
private PlexusContainer container; private PlexusContainer container;
private ArtifactFilterManager artifactFilterManager; private ArtifactFilterManager artifactFilterManager;
private WagonManager wagonManager;
public void addExtension( Extension extension, public void addExtension( Extension extension,
Model originatingModel, Model originatingModel,
@ -147,6 +151,18 @@ public class DefaultExtensionManager
} }
} }
public void registerWagons()
{
try
{
wagonManager.registerExtensionContainer( container );
}
catch ( ComponentLookupException e )
{
// no wagons found in the extension
}
}
public void contextualize( Context context ) public void contextualize( Context context )
throws ContextException throws ContextException
{ {

View File

@ -36,6 +36,8 @@ public interface ExtensionManager
{ {
void addExtension( Extension extension, MavenProject project, ArtifactRepository localRepository ) void addExtension( Extension extension, MavenProject project, ArtifactRepository localRepository )
throws ArtifactResolutionException, PlexusContainerException, ArtifactNotFoundException; throws ArtifactResolutionException, PlexusContainerException, ArtifactNotFoundException;
void registerWagons();
void addExtension( Extension extension, Model originatingModel, List remoteRepositories, void addExtension( Extension extension, Model originatingModel, List remoteRepositories,
ArtifactRepository localRepository ) ArtifactRepository localRepository )

View File

@ -82,6 +82,10 @@
<requirement> <requirement>
<role>org.apache.maven.artifact.metadata.ArtifactMetadataSource</role> <role>org.apache.maven.artifact.metadata.ArtifactMetadataSource</role>
</requirement> </requirement>
<requirement>
<role>org.apache.maven.wagon.manager.WagonManager</role>
<role-hint>default</role-hint>
</requirement>
</requirements> </requirements>
</component> </component>

14
pom.xml
View File

@ -40,6 +40,12 @@
<pluginRepository> <pluginRepository>
<id>apache.snapshots</id> <id>apache.snapshots</id>
<url>http://people.apache.org/repo/m2-snapshot-repository</url> <url>http://people.apache.org/repo/m2-snapshot-repository</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository> </pluginRepository>
</pluginRepositories> </pluginRepositories>
@ -47,7 +53,13 @@
<repositories> <repositories>
<repository> <repository>
<id>codehaus.snapshots</id> <id>codehaus.snapshots</id>
<url>http://snapshots.repository.codehaus.org/</url> <url>http://snapshots.repository.codehaus.org</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository> </repository>
</repositories> </repositories>