From b4257bad3bbbab31a5f21e25f03f9dfce50a420f Mon Sep 17 00:00:00 2001 From: Jason van Zyl Date: Sat, 21 Feb 2009 03:22:21 +0000 Subject: [PATCH] o use RepositorySystem and LegacyRepositorySystem git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@746432 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/maven/plugin/DefaultPluginManager.java | 8 ++++---- .../maven/plugin/version/DefaultPluginVersionManager.java | 4 ++-- .../java/org/apache/maven/embedder/MavenEmbedder.java | 6 +++--- .../execution/DefaultMavenExecutionRequestPopulator.java | 4 ++-- ...DefaultMavenTools.java => LegacyRepositorySystem.java} | 6 +++--- .../maven/{MavenTools.java => RepositorySystem.java} | 2 +- .../maven/profiles/build/DefaultProfileAdvisor.java | 4 ++-- .../apache/maven/project/DefaultMavenProjectBuilder.java | 4 ++-- .../org/apache/maven/project/DefaultProjectBuilder.java | 4 ++-- .../main/java/org/apache/maven/project/MavenProject.java | 4 ++-- .../apache/maven/project/builder/PomConstructionTest.java | 6 +++--- 11 files changed, 26 insertions(+), 26 deletions(-) rename maven-project/src/main/java/org/apache/maven/{DefaultMavenTools.java => LegacyRepositorySystem.java} (99%) rename maven-project/src/main/java/org/apache/maven/{MavenTools.java => RepositorySystem.java} (99%) diff --git a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java index 47cb0875da..e920b953b8 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java @@ -34,7 +34,7 @@ import java.util.Map; import java.util.Set; import org.apache.maven.ArtifactFilterManager; -import org.apache.maven.MavenTools; +import org.apache.maven.RepositorySystem; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; @@ -137,7 +137,7 @@ public class DefaultPluginManager protected PluginVersionManager pluginVersionManager; @Requirement - protected MavenTools repositoryTools; + protected RepositorySystem repositoryTools; @Requirement protected RuntimeInformation runtimeInformation; @@ -1471,7 +1471,7 @@ public class DefaultPluginManager // ---------------------------------------------------------------------- protected void resolveTransitiveDependencies( MavenSession context, - MavenTools repositoryTools, + RepositorySystem repositoryTools, String scope, MavenProject project, boolean isAggregator ) @@ -1582,7 +1582,7 @@ public class DefaultPluginManager private void downloadDependencies( MavenProject project, MavenSession context, - MavenTools repositoryTools ) + RepositorySystem repositoryTools ) throws ArtifactResolutionException, ArtifactNotFoundException { ArtifactRepository localRepository = context.getLocalRepository(); diff --git a/maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionManager.java b/maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionManager.java index 7717000455..f43b4af3aa 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/version/DefaultPluginVersionManager.java @@ -22,7 +22,7 @@ package org.apache.maven.plugin.version; import java.util.Iterator; import java.util.List; -import org.apache.maven.MavenTools; +import org.apache.maven.RepositorySystem; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.ArtifactUtils; import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException; @@ -51,7 +51,7 @@ public class DefaultPluginVersionManager implements PluginVersionManager { @Requirement - private MavenTools repositoryTools; + private RepositorySystem repositoryTools; @Requirement private MavenProjectBuilder mavenProjectBuilder; diff --git a/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java b/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java index 3a3e9eae11..9e77f737ac 100644 --- a/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java +++ b/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java @@ -31,7 +31,7 @@ import java.util.Iterator; import java.util.List; import org.apache.maven.Maven; -import org.apache.maven.MavenTools; +import org.apache.maven.RepositorySystem; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.resolver.ArtifactNotFoundException; @@ -137,7 +137,7 @@ public class MavenEmbedder private MavenXpp3Writer modelWriter; - private MavenTools repositoryTools; + private RepositorySystem repositoryTools; private Maven maven; @@ -659,7 +659,7 @@ public class MavenEmbedder pluginRepository = container.lookup( PluginRepository.class ); - repositoryTools = container.lookup( MavenTools.class ); + repositoryTools = container.lookup( RepositorySystem.class ); // This is temporary as we can probably cache a single request and use it for default values and // simply cascade values in from requests used for individual executions. diff --git a/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestPopulator.java b/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestPopulator.java index 8b5c180460..c57771c83e 100644 --- a/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestPopulator.java +++ b/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestPopulator.java @@ -26,7 +26,7 @@ import java.util.List; import java.util.Properties; import org.apache.maven.Maven; -import org.apache.maven.MavenTools; +import org.apache.maven.RepositorySystem; import org.apache.maven.artifact.InvalidRepositoryException; import org.apache.maven.artifact.manager.WagonManager; import org.apache.maven.artifact.repository.ArtifactRepository; @@ -87,7 +87,7 @@ public class DefaultMavenExecutionRequestPopulator private MavenSettingsBuilder settingsBuilder; @Requirement - private MavenTools mavenTools; + private RepositorySystem mavenTools; // 2009-02-12 Oleg: this component is defined in maven-core components.xml // because it already has another declared (not generated) component diff --git a/maven-project/src/main/java/org/apache/maven/DefaultMavenTools.java b/maven-project/src/main/java/org/apache/maven/LegacyRepositorySystem.java similarity index 99% rename from maven-project/src/main/java/org/apache/maven/DefaultMavenTools.java rename to maven-project/src/main/java/org/apache/maven/LegacyRepositorySystem.java index 4e81b01e4f..b144143b03 100644 --- a/maven-project/src/main/java/org/apache/maven/DefaultMavenTools.java +++ b/maven-project/src/main/java/org/apache/maven/LegacyRepositorySystem.java @@ -72,9 +72,9 @@ import org.codehaus.plexus.util.StringUtils; /** * @author Jason van Zyl */ -@Component(role = MavenTools.class) -public class DefaultMavenTools - implements MavenTools, LogEnabled +@Component(role = RepositorySystem.class) +public class LegacyRepositorySystem + implements RepositorySystem, LogEnabled { @Requirement private ArtifactFactory artifactFactory; diff --git a/maven-project/src/main/java/org/apache/maven/MavenTools.java b/maven-project/src/main/java/org/apache/maven/RepositorySystem.java similarity index 99% rename from maven-project/src/main/java/org/apache/maven/MavenTools.java rename to maven-project/src/main/java/org/apache/maven/RepositorySystem.java index 2d79e1e6a8..88a77c3280 100644 --- a/maven-project/src/main/java/org/apache/maven/MavenTools.java +++ b/maven-project/src/main/java/org/apache/maven/RepositorySystem.java @@ -51,7 +51,7 @@ import org.codehaus.plexus.component.annotations.Requirement; /** * @author Jason van Zyl */ -public interface MavenTools +public interface RepositorySystem { List buildArtifactRepositories( List repositories ) throws InvalidRepositoryException; diff --git a/maven-project/src/main/java/org/apache/maven/profiles/build/DefaultProfileAdvisor.java b/maven-project/src/main/java/org/apache/maven/profiles/build/DefaultProfileAdvisor.java index 1dc2e31e41..e912238c05 100644 --- a/maven-project/src/main/java/org/apache/maven/profiles/build/DefaultProfileAdvisor.java +++ b/maven-project/src/main/java/org/apache/maven/profiles/build/DefaultProfileAdvisor.java @@ -19,7 +19,7 @@ package org.apache.maven.profiles.build; * under the License. */ -import org.apache.maven.MavenTools; +import org.apache.maven.RepositorySystem; import org.apache.maven.artifact.ArtifactUtils; import org.apache.maven.artifact.InvalidRepositoryException; import org.apache.maven.artifact.repository.ArtifactRepository; @@ -60,7 +60,7 @@ public class DefaultProfileAdvisor public static final String ROLE_HINT = "default"; @Requirement - private MavenTools mavenTools; + private RepositorySystem mavenTools; @Requirement private MavenProfilesBuilder profilesBuilder; diff --git a/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java b/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java index a3933bda00..17b4bdd326 100644 --- a/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java +++ b/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java @@ -26,7 +26,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.maven.MavenTools; +import org.apache.maven.RepositorySystem; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.ArtifactUtils; import org.apache.maven.artifact.InvalidRepositoryException; @@ -74,7 +74,7 @@ public class DefaultMavenProjectBuilder private ProfileAdvisor profileAdvisor; @Requirement - private MavenTools mavenTools; + private RepositorySystem mavenTools; @Requirement private ProjectBuilder projectBuilder; diff --git a/maven-project/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java b/maven-project/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java index 44fef2b068..b80bb21925 100644 --- a/maven-project/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java +++ b/maven-project/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java @@ -22,7 +22,7 @@ package org.apache.maven.project; import java.io.*; import java.util.*; -import org.apache.maven.MavenTools; +import org.apache.maven.RepositorySystem; import org.apache.maven.mercury.PomProcessor; import org.apache.maven.mercury.PomProcessorException; import org.apache.maven.mercury.MavenDomainModel; @@ -61,7 +61,7 @@ public class DefaultProjectBuilder private ArtifactFactory artifactFactory; @Requirement - private MavenTools mavenTools; + private RepositorySystem mavenTools; @Requirement List listeners; diff --git a/maven-project/src/main/java/org/apache/maven/project/MavenProject.java b/maven-project/src/main/java/org/apache/maven/project/MavenProject.java index 9705d061c6..175a741737 100644 --- a/maven-project/src/main/java/org/apache/maven/project/MavenProject.java +++ b/maven-project/src/main/java/org/apache/maven/project/MavenProject.java @@ -34,7 +34,7 @@ import java.util.Properties; import java.util.Set; import java.util.Stack; -import org.apache.maven.MavenTools; +import org.apache.maven.RepositorySystem; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.ArtifactUtils; import org.apache.maven.artifact.DependencyResolutionRequiredException; @@ -213,7 +213,7 @@ public class MavenProject * @param projectBuilderConfiguration * @throws InvalidRepositoryException */ - public MavenProject( Model model, ArtifactFactory artifactFactory, MavenTools mavenTools, MavenProjectBuilder mavenProjectBuilder, ProjectBuilderConfiguration projectBuilderConfiguration ) + public MavenProject( Model model, ArtifactFactory artifactFactory, RepositorySystem mavenTools, MavenProjectBuilder mavenProjectBuilder, ProjectBuilderConfiguration projectBuilderConfiguration ) throws InvalidRepositoryException { if(model == null) diff --git a/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java b/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java index ecb0b0e47a..10726e9312 100644 --- a/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java +++ b/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java @@ -24,7 +24,7 @@ import java.io.IOException; import java.io.FileInputStream; import java.util.*; -import org.apache.maven.MavenTools; +import org.apache.maven.RepositorySystem; import org.apache.maven.profiles.DefaultProfileManager; import org.apache.maven.profiles.activation.DefaultProfileActivationContext; import org.apache.maven.profiles.activation.ProfileActivationContext; @@ -52,7 +52,7 @@ public class PomConstructionTest private MavenProjectBuilder mavenProjectBuilder; - private MavenTools mavenTools; + private RepositorySystem mavenTools; private PomArtifactResolver pomArtifactResolver; @@ -67,7 +67,7 @@ public class PomConstructionTest testMixinDirectory = new File( getBasedir(), BASE_MIXIN_DIR ); mavenProjectBuilder = lookup( MavenProjectBuilder.class ); projectBuilder = lookup( ProjectBuilder.class ); - mavenTools = lookup( MavenTools.class ); + mavenTools = lookup( RepositorySystem.class ); pomArtifactResolver = new PomArtifactResolver() {