From 21d261f50355041d10c255b6c90a298ebb26004d Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Fri, 22 Apr 2005 05:19:04 +0000 Subject: [PATCH] clean the artifact factory interface a little git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@164172 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/maven/artifact/MavenMetadataSource.java | 2 +- .../apache/maven/artifact/factory/ArtifactFactory.java | 4 +--- .../maven/artifact/factory/DefaultArtifactFactory.java | 6 +++--- .../apache/maven/project/DefaultMavenProjectBuilder.java | 2 +- .../maven/project/ProjectClasspathArtifactResolver.java | 2 +- maven-site/src/site/xdoc/configuration.xml | 4 ++-- maven-site/src/site/xdoc/getting-started.xml | 9 +++++++++ 7 files changed, 18 insertions(+), 11 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/artifact/MavenMetadataSource.java b/maven-core/src/main/java/org/apache/maven/artifact/MavenMetadataSource.java index a9f9635bd3..b6a177c58d 100644 --- a/maven-core/src/main/java/org/apache/maven/artifact/MavenMetadataSource.java +++ b/maven-core/src/main/java/org/apache/maven/artifact/MavenMetadataSource.java @@ -131,6 +131,6 @@ public class MavenMetadataSource IoUtils.close( reader ); } } - return artifactFactory.createArtifacts( dependencies, localRepository, artifact.getScope() ); + return artifactFactory.createArtifacts( dependencies, artifact.getScope() ); } } diff --git a/maven-core/src/main/java/org/apache/maven/artifact/factory/ArtifactFactory.java b/maven-core/src/main/java/org/apache/maven/artifact/factory/ArtifactFactory.java index 48261a26b0..6f0e710bf5 100644 --- a/maven-core/src/main/java/org/apache/maven/artifact/factory/ArtifactFactory.java +++ b/maven-core/src/main/java/org/apache/maven/artifact/factory/ArtifactFactory.java @@ -27,9 +27,7 @@ public interface ArtifactFactory { static String ROLE = ArtifactFactory.class.getName(); - Set createArtifacts( List dependencies, ArtifactRepository localRepository, String inheritedScope ); - - Artifact createArtifact( Dependency dependency, ArtifactRepository localRepository, String inheritedScope ); + Set createArtifacts( List dependencies, String inheritedScope ); Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type, String inheritedScope ); diff --git a/maven-core/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java b/maven-core/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java index ae8bff7d2c..1b76e0c641 100644 --- a/maven-core/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java +++ b/maven-core/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java @@ -30,7 +30,7 @@ public class DefaultArtifactFactory extends ArtifactConstructionSupport implements ArtifactFactory { - public Set createArtifacts( List dependencies, ArtifactRepository localRepository, String inheritedScope ) + public Set createArtifacts( List dependencies, String inheritedScope ) { Set projectArtifacts = new HashSet(); @@ -38,7 +38,7 @@ public class DefaultArtifactFactory { Dependency d = (Dependency) i.next(); - Artifact artifact = createArtifact( d, localRepository, inheritedScope ); + Artifact artifact = createArtifact( d, inheritedScope ); if ( artifact != null ) { projectArtifacts.add( artifact ); @@ -48,7 +48,7 @@ public class DefaultArtifactFactory return projectArtifacts; } - public Artifact createArtifact( Dependency dependency, ArtifactRepository localRepository, String inheritedScope ) + private Artifact createArtifact( Dependency dependency, String inheritedScope ) { return createArtifact( dependency.getGroupId(), dependency.getArtifactId(), dependency.getVersion(), dependency.getScope(), dependency.getType(), inheritedScope ); 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 06c2e83de7..f52f49c2e5 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 @@ -251,7 +251,7 @@ public class DefaultMavenProjectBuilder project.setParent( parentProject ); project.setRemoteArtifactRepositories( remoteRepositories ); - project.setArtifacts( artifactFactory.createArtifacts( project.getDependencies(), localRepository, null ) ); + project.setArtifacts( artifactFactory.createArtifacts( project.getDependencies(), null ) ); // ---------------------------------------------------------------------- // Typically when the project builder is being used from maven proper diff --git a/maven-core/src/test/java/org/apache/maven/project/ProjectClasspathArtifactResolver.java b/maven-core/src/test/java/org/apache/maven/project/ProjectClasspathArtifactResolver.java index f60d3385eb..6557f120ff 100644 --- a/maven-core/src/test/java/org/apache/maven/project/ProjectClasspathArtifactResolver.java +++ b/maven-core/src/test/java/org/apache/maven/project/ProjectClasspathArtifactResolver.java @@ -77,7 +77,7 @@ public class ProjectClasspathArtifactResolver { IOUtil.close( r ); } - return artifactFactory.createArtifacts( model.getDependencies(), localRepository, artifact.getScope() ); + return artifactFactory.createArtifacts( model.getDependencies(), artifact.getScope() ); } } diff --git a/maven-site/src/site/xdoc/configuration.xml b/maven-site/src/site/xdoc/configuration.xml index 0c4775727b..a6f2dc3d0b 100644 --- a/maven-site/src/site/xdoc/configuration.xml +++ b/maven-site/src/site/xdoc/configuration.xml @@ -34,10 +34,10 @@

- User configuration is specified in - ${user.home}/.m2/settings.xml. A + You can specify your user configuration in ${user.home}/.m2/settings.xml. A full reference to the configuration file is available. This section will show how to make some common configurations. + Note that the file is not required - defaults will be used if it is not found.

Configuring your Local Repository diff --git a/maven-site/src/site/xdoc/getting-started.xml b/maven-site/src/site/xdoc/getting-started.xml index 50f0c12cfd..7120b36172 100644 --- a/maven-site/src/site/xdoc/getting-started.xml +++ b/maven-site/src/site/xdoc/getting-started.xml @@ -97,6 +97,11 @@

This will do all of the steps - generating sources, compiling, copying resources, packaging and finally installing.

+

+ If you try that, you'll see that the file is copied to a directory under ~/.m2/repository. + This is also where all those downloaded files go - it is called your local repository. + The location is configurable - see Configuration for more information. +