From 36eced2a735e17f4cf75ab790d63106943b52c95 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Tue, 13 Feb 2007 23:14:14 +0000 Subject: [PATCH] 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 --- .../extension/DefaultBuildExtensionScanner.java | 2 ++ .../maven/extension/DefaultExtensionManager.java | 16 ++++++++++++++++ .../apache/maven/extension/ExtensionManager.java | 2 ++ .../resources/META-INF/plexus/components.xml | 4 ++++ pom.xml | 14 +++++++++++++- 5 files changed, 37 insertions(+), 1 deletion(-) diff --git a/maven-core/src/main/java/org/apache/maven/extension/DefaultBuildExtensionScanner.java b/maven-core/src/main/java/org/apache/maven/extension/DefaultBuildExtensionScanner.java index 864f1f01ad..8aafc8804e 100644 --- a/maven-core/src/main/java/org/apache/maven/extension/DefaultBuildExtensionScanner.java +++ b/maven-core/src/main/java/org/apache/maven/extension/DefaultBuildExtensionScanner.java @@ -94,6 +94,8 @@ public class DefaultBuildExtensionScanner } getLogger().debug( "Finished pre-scanning: " + pom + " for build extensions." ); + + extensionManager.registerWagons(); } catch ( ModelInterpolationException e ) { diff --git a/maven-core/src/main/java/org/apache/maven/extension/DefaultExtensionManager.java b/maven-core/src/main/java/org/apache/maven/extension/DefaultExtensionManager.java index a22a3a2cb1..80d2e843a6 100644 --- a/maven-core/src/main/java/org/apache/maven/extension/DefaultExtensionManager.java +++ b/maven-core/src/main/java/org/apache/maven/extension/DefaultExtensionManager.java @@ -31,9 +31,11 @@ import org.apache.maven.model.Extension; import org.apache.maven.model.Model; import org.apache.maven.model.Parent; import org.apache.maven.project.MavenProject; +import org.apache.maven.wagon.manager.WagonManager; import org.codehaus.plexus.PlexusConstants; import org.codehaus.plexus.PlexusContainer; import org.codehaus.plexus.PlexusContainerException; +import org.codehaus.plexus.component.repository.exception.ComponentLookupException; import org.codehaus.plexus.context.Context; import org.codehaus.plexus.context.ContextException; import org.codehaus.plexus.logging.AbstractLogEnabled; @@ -64,6 +66,8 @@ public class DefaultExtensionManager private PlexusContainer container; private ArtifactFilterManager artifactFilterManager; + + private WagonManager wagonManager; public void addExtension( Extension extension, 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 ) throws ContextException { diff --git a/maven-core/src/main/java/org/apache/maven/extension/ExtensionManager.java b/maven-core/src/main/java/org/apache/maven/extension/ExtensionManager.java index b0625fa091..b751bfdd84 100644 --- a/maven-core/src/main/java/org/apache/maven/extension/ExtensionManager.java +++ b/maven-core/src/main/java/org/apache/maven/extension/ExtensionManager.java @@ -36,6 +36,8 @@ public interface ExtensionManager { void addExtension( Extension extension, MavenProject project, ArtifactRepository localRepository ) throws ArtifactResolutionException, PlexusContainerException, ArtifactNotFoundException; + + void registerWagons(); void addExtension( Extension extension, Model originatingModel, List remoteRepositories, ArtifactRepository localRepository ) diff --git a/maven-core/src/main/resources/META-INF/plexus/components.xml b/maven-core/src/main/resources/META-INF/plexus/components.xml index 84e95d9ccb..c1c1597d65 100644 --- a/maven-core/src/main/resources/META-INF/plexus/components.xml +++ b/maven-core/src/main/resources/META-INF/plexus/components.xml @@ -82,6 +82,10 @@ org.apache.maven.artifact.metadata.ArtifactMetadataSource + + org.apache.maven.wagon.manager.WagonManager + default + diff --git a/pom.xml b/pom.xml index 6ae9458b95..5873e15ac5 100644 --- a/pom.xml +++ b/pom.xml @@ -40,6 +40,12 @@ apache.snapshots http://people.apache.org/repo/m2-snapshot-repository + + false + + + true + @@ -47,7 +53,13 @@ codehaus.snapshots - http://snapshots.repository.codehaus.org/ + http://snapshots.repository.codehaus.org + + false + + + true +