maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r428688 - in /maven/repository-manager/trunk: maven-repository-core/src/main/java/org/apache/maven/repository/configuration/ maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/
Date Fri, 04 Aug 2006 10:48:33 GMT
Author: brett
Date: Fri Aug  4 03:48:33 2006
New Revision: 428688

URL: http://svn.apache.org/viewvc?rev=428688&view=rev
Log:
[MRM-138] correct repository handling

Modified:
    maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/configuration/DefaultConfiguredRepositoryFactory.java
    maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/ShowArtifactAction.java

Modified: maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/configuration/DefaultConfiguredRepositoryFactory.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/configuration/DefaultConfiguredRepositoryFactory.java?rev=428688&r1=428687&r2=428688&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/configuration/DefaultConfiguredRepositoryFactory.java
(original)
+++ maven/repository-manager/trunk/maven-repository-core/src/main/java/org/apache/maven/repository/configuration/DefaultConfiguredRepositoryFactory.java
Fri Aug  4 03:48:33 2006
@@ -51,8 +51,7 @@
         String repoDir = repositoryDirectory.toURI().toString();
 
         ArtifactRepositoryLayout layout = (ArtifactRepositoryLayout) repositoryLayouts.get(
configuration.getLayout() );
-        // TODO! real ID
-        return repoFactory.createArtifactRepository( "test", repoDir, layout, null, null
);
+        return repoFactory.createArtifactRepository( configuration.getId(), repoDir, layout,
null, null );
     }
 
     public List createRepositories( Configuration configuration )

Modified: maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/ShowArtifactAction.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/ShowArtifactAction.java?rev=428688&r1=428687&r2=428688&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/ShowArtifactAction.java
(original)
+++ maven/repository-manager/trunk/maven-repository-webapp/src/main/java/org/apache/maven/repository/manager/web/action/ShowArtifactAction.java
Fri Aug  4 03:48:33 2006
@@ -19,6 +19,7 @@
 import com.opensymphony.xwork.ActionSupport;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.model.Model;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.MavenProjectBuilder;
@@ -27,9 +28,11 @@
 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;
 
@@ -98,11 +101,21 @@
 
         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,
null );
+        MavenProject project = projectBuilder.buildFromRepository( artifact, repositories,
getLocalRepository() );
 
         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()



Mime
View raw message