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.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 )

View File

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

View File

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

View File

@ -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

View File

@ -227,11 +227,7 @@
<role>org.apache.maven.project.path.PathTranslator</role>
<implementation>org.apache.maven.project.path.DefaultPathTranslator</implementation>
</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>
<role>org.apache.maven.settings.MavenSettingsBuilder</role>
<implementation>org.apache.maven.settings.DefaultMavenSettingsBuilder</implementation>

View File

@ -24,12 +24,6 @@
<requirement>
<role>org.apache.maven.project.path.PathTranslator</role>
</requirement>
<requirement>
<role>org.apache.maven.artifact.repository.ArtifactRepositoryFactory</role>
</requirement>
<requirement>
<role>org.apache.maven.settings.MavenSettingsBuilder</role>
</requirement>
<requirement>
<role>org.codehaus.plexus.component.configurator.ComponentConfigurator</role>
</requirement>
@ -38,26 +32,12 @@
</requirement>
</requirements>
</component>
<!-- Duplicated from Maven core as it is used in the plugin manager -->
<component>
<role>org.apache.maven.project.path.PathTranslator</role>
<implementation>org.apache.maven.project.path.DefaultPathTranslator</implementation>
</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 -->
<component>