From 8a6d97d0fa0b338148fe6d35fc93c526d4727ce6 Mon Sep 17 00:00:00 2001 From: Brett Porter Date: Fri, 4 Aug 2006 11:10:50 +0000 Subject: [PATCH] [MRM-138] move local repository to a permanent location git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@428694 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/mdo/configuration.mdo | 13 +++++++++++++ .../ConfiguredRepositoryFactory.java | 8 ++++++++ .../DefaultConfiguredRepositoryFactory.java | 6 ++++++ maven-repository-webapp/pom.xml | 6 ++++++ .../manager/web/action/ShowArtifactAction.java | 15 ++------------- 5 files changed, 35 insertions(+), 13 deletions(-) diff --git a/maven-repository-configuration/src/main/mdo/configuration.mdo b/maven-repository-configuration/src/main/mdo/configuration.mdo index 66ed605dd..423745d24 100644 --- a/maven-repository-configuration/src/main/mdo/configuration.mdo +++ b/maven-repository-configuration/src/main/mdo/configuration.mdo @@ -24,6 +24,14 @@ * + + localRepository + 1.0.0 + String + + The location of the local repository. + + indexPath 1.0.0 @@ -67,6 +75,11 @@ 1.0.0 plexus-log4j-logging 1.1-alpha-2 + + org.apache.maven.wagon + wagon-file + 1.0-beta-1 + runtime + org.codehaus.plexus plexus-container-default diff --git a/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/ShowArtifactAction.java b/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/ShowArtifactAction.java index defa8134f..b739f6aa9 100644 --- a/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/ShowArtifactAction.java +++ b/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/ShowArtifactAction.java @@ -28,11 +28,9 @@ import org.apache.maven.repository.configuration.Configuration; import org.apache.maven.repository.configuration.ConfigurationStore; import org.apache.maven.repository.configuration.ConfigurationStoreException; import org.apache.maven.repository.configuration.ConfiguredRepositoryFactory; -import org.apache.maven.repository.configuration.RepositoryConfiguration; import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; -import java.io.File; import java.io.IOException; import java.util.List; @@ -101,23 +99,14 @@ public class ShowArtifactAction Artifact artifact = artifactFactory.createProjectArtifact( groupId, artifactId, version ); // TODO: maybe we can decouple the assembly parts of the project builder from the repository handling to get rid of the temp repo - MavenProject project = projectBuilder.buildFromRepository( artifact, repositories, getLocalRepository() ); + ArtifactRepository localRepository = repositoryFactory.createLocalRepository( configuration ); + MavenProject project = projectBuilder.buildFromRepository( artifact, repositories, localRepository ); model = project.getModel(); return SUCCESS; } - private ArtifactRepository getLocalRepository() - throws IOException - { - // TODO: do we want this to be configurable? - RepositoryConfiguration configuration = new RepositoryConfiguration(); - configuration.setId( "local" ); - configuration.setDirectory( File.createTempFile( "repository", "local" ).getAbsolutePath() ); - return repositoryFactory.createRepository( configuration ); - } - public Model getModel() { return model;