From a803fc26b40614e20dc983feab963c8f7905dada Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Fri, 22 Apr 2005 08:48:41 +0000 Subject: [PATCH] move artifact repository factory into maven-artifact git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@164201 13f79535-47bb-0310-9956-ffa450edef68 --- .../repository/ArtifactRepositoryFactory.java | 0 .../DefaultArtifactRepositoryFactory.java | 4 ---- .../resources/META-INF/plexus/components.xml | 5 ++++ .../maven/plugin/DefaultPluginManager.java | 4 ---- .../project/DefaultMavenProjectBuilder.java | 4 +++- .../resources/META-INF/plexus/components.xml | 6 +---- .../main/resources/META-INF/plexus/plexus.xml | 24 ++----------------- 7 files changed, 11 insertions(+), 36 deletions(-) rename {maven-core => maven-artifact}/src/main/java/org/apache/maven/artifact/repository/ArtifactRepositoryFactory.java (100%) rename {maven-core => maven-artifact}/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepositoryFactory.java (91%) diff --git a/maven-core/src/main/java/org/apache/maven/artifact/repository/ArtifactRepositoryFactory.java b/maven-artifact/src/main/java/org/apache/maven/artifact/repository/ArtifactRepositoryFactory.java similarity index 100% rename from maven-core/src/main/java/org/apache/maven/artifact/repository/ArtifactRepositoryFactory.java rename to maven-artifact/src/main/java/org/apache/maven/artifact/repository/ArtifactRepositoryFactory.java diff --git a/maven-core/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepositoryFactory.java b/maven-artifact/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepositoryFactory.java similarity index 91% rename from maven-core/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepositoryFactory.java rename to maven-artifact/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepositoryFactory.java index 8d05e4ebd3..29662c64f6 100644 --- a/maven-core/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepositoryFactory.java +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepositoryFactory.java @@ -17,7 +17,6 @@ package org.apache.maven.artifact.repository; */ import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; -import org.apache.maven.settings.MavenSettingsBuilder; import org.codehaus.plexus.logging.AbstractLogEnabled; /** @@ -30,9 +29,6 @@ public class DefaultArtifactRepositoryFactory // TODO: use settings? private String globalSnapshotPolicy = null; - // TODO: make this a store once object? - private MavenSettingsBuilder settingsBuilder; - public ArtifactRepository createArtifactRepository( String id, String url, ArtifactRepositoryLayout repositoryLayout, String snapshotPolicy ) diff --git a/maven-artifact/src/main/resources/META-INF/plexus/components.xml b/maven-artifact/src/main/resources/META-INF/plexus/components.xml index ab3dcc2bff..111e34e9e5 100644 --- a/maven-artifact/src/main/resources/META-INF/plexus/components.xml +++ b/maven-artifact/src/main/resources/META-INF/plexus/components.xml @@ -180,5 +180,10 @@ org.apache.maven.artifact.factory.ArtifactFactory org.apache.maven.artifact.factory.DefaultArtifactFactory + + + org.apache.maven.artifact.repository.ArtifactRepositoryFactory + org.apache.maven.artifact.repository.DefaultArtifactRepositoryFactory + 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 f12005d30a..4e60a6a121 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 @@ -89,10 +89,6 @@ public class DefaultPluginManager protected PathTranslator pathTranslator; - protected ArtifactRepositoryFactory artifactRepositoryFactory; - - protected MavenSettingsBuilder mavenSettingsBuilder; - protected ComponentConfigurator configurator; private ArtifactFactory artifactFactory; diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java b/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java index 7fcb67b979..368ab510b7 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java @@ -74,6 +74,7 @@ public class DefaultMavenProjectBuilder extends AbstractLogEnabled implements MavenProjectBuilder, Initializable, Contextualizable { + // TODO: remove private PlexusContainer container; private ArtifactResolver artifactResolver; @@ -382,8 +383,9 @@ public class DefaultMavenProjectBuilder { String id = repo.getId(); String url = repo.getUrl(); - ArtifactRepositoryLayout layout = getRepositoryLayout( repo ); String snapshotPolicy = repo.getSnapshotPolicy(); + // TODO: make this a map inside the factory instead, so no lookup needed + ArtifactRepositoryLayout layout = getRepositoryLayout( repo ); return artifactRepositoryFactory.createArtifactRepository( id, url, layout, snapshotPolicy ); } else 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 f0d5635f21..7a966f1e9d 100644 --- a/maven-core/src/main/resources/META-INF/plexus/components.xml +++ b/maven-core/src/main/resources/META-INF/plexus/components.xml @@ -227,11 +227,7 @@ org.apache.maven.project.path.PathTranslator org.apache.maven.project.path.DefaultPathTranslator - + org.apache.maven.settings.MavenSettingsBuilder org.apache.maven.settings.DefaultMavenSettingsBuilder diff --git a/maven-core/src/main/resources/META-INF/plexus/plexus.xml b/maven-core/src/main/resources/META-INF/plexus/plexus.xml index a48b21967e..6cc8f93e08 100644 --- a/maven-core/src/main/resources/META-INF/plexus/plexus.xml +++ b/maven-core/src/main/resources/META-INF/plexus/plexus.xml @@ -24,12 +24,6 @@ org.apache.maven.project.path.PathTranslator - - org.apache.maven.artifact.repository.ArtifactRepositoryFactory - - - org.apache.maven.settings.MavenSettingsBuilder - org.codehaus.plexus.component.configurator.ComponentConfigurator @@ -38,26 +32,12 @@ + + org.apache.maven.project.path.PathTranslator org.apache.maven.project.path.DefaultPathTranslator - - org.apache.maven.artifact.repository.ArtifactRepositoryFactory - org.apache.maven.artifact.repository.DefaultArtifactRepositoryFactory - - - org.apache.maven.settings.MavenSettingsBuilder - - - - - org.apache.maven.settings.MavenSettingsBuilder - org.apache.maven.settings.DefaultMavenSettingsBuilder - - ${user.home}/.m2/settings.xml - -