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
This commit is contained in:
Brett Leslie Porter 2005-04-22 08:48:41 +00:00
parent 874a8c1245
commit a803fc26b4
7 changed files with 11 additions and 36 deletions

View File

@ -17,7 +17,6 @@ package org.apache.maven.artifact.repository;
*/ */
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.settings.MavenSettingsBuilder;
import org.codehaus.plexus.logging.AbstractLogEnabled; import org.codehaus.plexus.logging.AbstractLogEnabled;
/** /**
@ -30,9 +29,6 @@ public class DefaultArtifactRepositoryFactory
// TODO: use settings? // TODO: use settings?
private String globalSnapshotPolicy = null; private String globalSnapshotPolicy = null;
// TODO: make this a store once object?
private MavenSettingsBuilder settingsBuilder;
public ArtifactRepository createArtifactRepository( String id, String url, public ArtifactRepository createArtifactRepository( String id, String url,
ArtifactRepositoryLayout repositoryLayout, ArtifactRepositoryLayout repositoryLayout,
String snapshotPolicy ) String snapshotPolicy )

View File

@ -180,5 +180,10 @@
<role>org.apache.maven.artifact.factory.ArtifactFactory</role> <role>org.apache.maven.artifact.factory.ArtifactFactory</role>
<implementation>org.apache.maven.artifact.factory.DefaultArtifactFactory</implementation> <implementation>org.apache.maven.artifact.factory.DefaultArtifactFactory</implementation>
</component> </component>
<component>
<role>org.apache.maven.artifact.repository.ArtifactRepositoryFactory</role>
<implementation>org.apache.maven.artifact.repository.DefaultArtifactRepositoryFactory</implementation>
</component>
</components> </components>
</component-set> </component-set>

View File

@ -89,10 +89,6 @@ public class DefaultPluginManager
protected PathTranslator pathTranslator; protected PathTranslator pathTranslator;
protected ArtifactRepositoryFactory artifactRepositoryFactory;
protected MavenSettingsBuilder mavenSettingsBuilder;
protected ComponentConfigurator configurator; protected ComponentConfigurator configurator;
private ArtifactFactory artifactFactory; private ArtifactFactory artifactFactory;

View File

@ -74,6 +74,7 @@ public class DefaultMavenProjectBuilder
extends AbstractLogEnabled extends AbstractLogEnabled
implements MavenProjectBuilder, Initializable, Contextualizable implements MavenProjectBuilder, Initializable, Contextualizable
{ {
// TODO: remove
private PlexusContainer container; private PlexusContainer container;
private ArtifactResolver artifactResolver; private ArtifactResolver artifactResolver;
@ -382,8 +383,9 @@ public class DefaultMavenProjectBuilder
{ {
String id = repo.getId(); String id = repo.getId();
String url = repo.getUrl(); String url = repo.getUrl();
ArtifactRepositoryLayout layout = getRepositoryLayout( repo );
String snapshotPolicy = repo.getSnapshotPolicy(); 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 ); return artifactRepositoryFactory.createArtifactRepository( id, url, layout, snapshotPolicy );
} }
else else

View File

@ -227,11 +227,7 @@
<role>org.apache.maven.project.path.PathTranslator</role> <role>org.apache.maven.project.path.PathTranslator</role>
<implementation>org.apache.maven.project.path.DefaultPathTranslator</implementation> <implementation>org.apache.maven.project.path.DefaultPathTranslator</implementation>
</component> </component>
<!-- ********************* FIXME *******************************************
| NOTE: This is also declared in plexus.xml for maven. We currently need it
| in both places, for systems that don't use maven's plexus.xml. This will
| become unnecessary when multiple plexus.xml files are allowed in plexus.
-->
<component> <component>
<role>org.apache.maven.settings.MavenSettingsBuilder</role> <role>org.apache.maven.settings.MavenSettingsBuilder</role>
<implementation>org.apache.maven.settings.DefaultMavenSettingsBuilder</implementation> <implementation>org.apache.maven.settings.DefaultMavenSettingsBuilder</implementation>

View File

@ -24,12 +24,6 @@
<requirement> <requirement>
<role>org.apache.maven.project.path.PathTranslator</role> <role>org.apache.maven.project.path.PathTranslator</role>
</requirement> </requirement>
<requirement>
<role>org.apache.maven.artifact.repository.ArtifactRepositoryFactory</role>
</requirement>
<requirement>
<role>org.apache.maven.settings.MavenSettingsBuilder</role>
</requirement>
<requirement> <requirement>
<role>org.codehaus.plexus.component.configurator.ComponentConfigurator</role> <role>org.codehaus.plexus.component.configurator.ComponentConfigurator</role>
</requirement> </requirement>
@ -38,26 +32,12 @@
</requirement> </requirement>
</requirements> </requirements>
</component> </component>
<!-- Duplicated from Maven core as it is used in the plugin manager -->
<component> <component>
<role>org.apache.maven.project.path.PathTranslator</role> <role>org.apache.maven.project.path.PathTranslator</role>
<implementation>org.apache.maven.project.path.DefaultPathTranslator</implementation> <implementation>org.apache.maven.project.path.DefaultPathTranslator</implementation>
</component> </component>
<component>
<role>org.apache.maven.artifact.repository.ArtifactRepositoryFactory</role>
<implementation>org.apache.maven.artifact.repository.DefaultArtifactRepositoryFactory</implementation>
<requirements>
<requirement>
<role>org.apache.maven.settings.MavenSettingsBuilder</role>
</requirement>
</requirements>
</component>
<component>
<role>org.apache.maven.settings.MavenSettingsBuilder</role>
<implementation>org.apache.maven.settings.DefaultMavenSettingsBuilder</implementation>
<configuration>
<settingsPath>${user.home}/.m2/settings.xml</settingsPath>
</configuration>
</component>
<!-- Duplicated from Maven artifact as it is used in the plugin manager --> <!-- Duplicated from Maven artifact as it is used in the plugin manager -->
<component> <component>