archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1403489 - in /archiva/trunk: ./ archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/archetype-resources/src/main/java/ archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/ archiva-...
Date Mon, 29 Oct 2012 20:41:02 GMT
Author: olamy
Date: Mon Oct 29 20:41:00 2012
New Revision: 1403489

URL: http://svn.apache.org/viewvc?rev=1403489&view=rev
Log:
[MRM-1704] Refactor to remove maven specific part from various repository/metadata apis

Removed:
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/AbstractDefaultRepositoryContent.java
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/AbstractLegacyRepositoryContent.java
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/ArtifactExtensionMapping.java
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/DefaultPathParser.java
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/FilenameParser.java
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/LegacyPathParser.java
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/ManagedDefaultRepositoryContent.java
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/ManagedLegacyRepositoryContent.java
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/RemoteDefaultRepositoryContent.java
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/RemoteLegacyRepositoryContent.java
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/RepositoryRequest.java
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/content/AbstractDefaultRepositoryContentTestCase.java
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/content/ArtifactExtensionMappingTest.java
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/content/DefaultPathParserTest.java
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/content/FilenameParserTest.java
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/content/LegacyPathParserTest.java
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/content/ManagedDefaultRepositoryContentTest.java
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/content/ManagedLegacyRepositoryContentTest.java
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/content/RemoteDefaultRepositoryContentTest.java
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/content/RemoteLegacyRepositoryContentTest.java
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/test/java/org/apache/archiva/repository/content/RepositoryRequestTest.java
    archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/MavenArtifactFacet.java
Modified:
    archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/archetype-resources/src/main/java/SimpleArtifactConsumer.java
    archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml
    archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/AutoRenameConsumer.java
    archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurge.java
    archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/ArtifactFilenameFilter.java
    archiva/trunk/archiva-modules/archiva-base/archiva-converter/pom.xml
    archiva/trunk/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java
    archiva/trunk/archiva-modules/archiva-base/archiva-proxy/pom.xml
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml
    archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/pom.xml
    archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/ArchivaDavResourceFactoryTest.java
    archiva/trunk/archiva-modules/metadata/metadata-repository-api/pom.xml
    archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryStorage.java
    archiva/trunk/archiva-modules/metadata/pom.xml
    archiva/trunk/archiva-modules/plugins/maven2-repository/pom.xml
    archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryPathTranslator.java
    archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java
    archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/MavenArtifactFacetFactory.java
    archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/resources/META-INF/spring-context.xml
    archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java
    archiva/trunk/archiva-modules/plugins/repository-statistics/pom.xml
    archiva/trunk/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/DefaultRepositoryStatisticsManager.java
    archiva/trunk/archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/RepositoryStatisticsManagerTest.java
    archiva/trunk/pom.xml

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/archetype-resources/src/main/java/SimpleArtifactConsumer.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/archetype-resources/src/main/java/SimpleArtifactConsumer.java?rev=1403489&r1=1403488&r2=1403489&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/archetype-resources/src/main/java/SimpleArtifactConsumer.java
(original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/src/main/resources/archetype-resources/src/main/java/SimpleArtifactConsumer.java
Mon Oct 29 20:41:00 2012
@@ -28,8 +28,6 @@ import org.apache.archiva.configuration.
 import org.apache.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.archiva.consumers.ConsumerException;
 import org.apache.archiva.consumers.KnownRepositoryContentConsumer;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
-import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
 import org.apache.archiva.redback.components.registry.Registry;
 import org.apache.archiva.redback.components.registry.RegistryListener;
 
@@ -160,7 +158,6 @@ public class SimpleArtifactConsumer
 
     @PostConstruct
     public void initialize()
-        throws InitializationException
     {
         propertyNameTriggers = new ArrayList();
         propertyNameTriggers.add( "repositoryScanning" );

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml?rev=1403489&r1=1403488&r2=1403489&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml
(original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml
Mon Oct 29 20:41:00 2012
@@ -65,6 +65,14 @@
       <artifactId>metadata-repository-api</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>metadata-model-maven2</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-plexus-bridge</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-digest</artifactId>
       <exclusions>

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/AutoRenameConsumer.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/AutoRenameConsumer.java?rev=1403489&r1=1403488&r2=1403489&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/AutoRenameConsumer.java
(original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/AutoRenameConsumer.java
Mon Oct 29 20:41:00 2012
@@ -132,10 +132,10 @@ public class AutoRenameConsumer
             Iterator<String> itExtensions = this.extensionRenameMap.keySet().iterator();
             while ( itExtensions.hasNext() )
             {
-                String extension = (String) itExtensions.next();
+                String extension = itExtensions.next();
                 if ( path.endsWith( extension ) )
                 {
-                    String fixedExtension = (String) this.extensionRenameMap.get( extension
);
+                    String fixedExtension = this.extensionRenameMap.get( extension );
                     String correctedPath = path.substring( 0, path.length() - extension.length()
) + fixedExtension;
                     File to = new File( this.repositoryDir, correctedPath );
                     try

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurge.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurge.java?rev=1403489&r1=1403488&r2=1403489&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurge.java
(original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/AbstractRepositoryPurge.java
Mon Oct 29 20:41:00 2012
@@ -22,11 +22,11 @@ package org.apache.archiva.consumers.cor
 import org.apache.archiva.audit.AuditEvent;
 import org.apache.archiva.common.utils.VersionUtil;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
+import org.apache.archiva.metadata.model.maven2.MavenArtifactFacet;
 import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.archiva.metadata.repository.MetadataRepositoryException;
 import org.apache.archiva.metadata.repository.MetadataResolutionException;
 import org.apache.archiva.metadata.repository.RepositorySession;
-import org.apache.archiva.metadata.repository.storage.maven2.MavenArtifactFacet;
 import org.apache.archiva.model.ArtifactReference;
 import org.apache.archiva.repository.ContentNotFoundException;
 import org.apache.archiva.repository.ManagedRepositoryContent;

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/ArtifactFilenameFilter.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/ArtifactFilenameFilter.java?rev=1403489&r1=1403488&r2=1403489&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/ArtifactFilenameFilter.java
(original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/ArtifactFilenameFilter.java
Mon Oct 29 20:41:00 2012
@@ -33,7 +33,7 @@ public class ArtifactFilenameFilter
 
     public ArtifactFilenameFilter()
     {
-
+        // no op
     }
 
     public ArtifactFilenameFilter( String filename )

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-converter/pom.xml
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-converter/pom.xml?rev=1403489&r1=1403488&r2=1403489&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-converter/pom.xml (original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-converter/pom.xml Mon Oct 29 20:41:00
2012
@@ -64,6 +64,10 @@
       <artifactId>archiva-common</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>maven2-repository</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-i18n</artifactId>
     </dependency>
@@ -115,6 +119,7 @@
               org.apache.maven.model*,
               org.codehaus.plexus.digest,
               org.codehaus.plexus.util*,
+              org.apache.archiva.repository.content.maven2,
               org.slf4j;resolution:=optional
             </Import-Package>
           </instructions>

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java?rev=1403489&r1=1403488&r2=1403489&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java
(original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java
Mon Oct 29 20:41:00 2012
@@ -29,7 +29,7 @@ import org.apache.archiva.converter.arti
 import org.apache.archiva.converter.artifact.ArtifactConverter;
 import org.apache.archiva.model.ArtifactReference;
 import org.apache.archiva.repository.ManagedRepositoryContent;
-import org.apache.archiva.repository.content.ManagedDefaultRepositoryContent;
+import org.apache.archiva.repository.content.maven2.ManagedDefaultRepositoryContent;
 import org.apache.archiva.repository.layout.LayoutException;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.factory.ArtifactFactory;

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-proxy/pom.xml
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-proxy/pom.xml?rev=1403489&r1=1403488&r2=1403489&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-proxy/pom.xml (original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-proxy/pom.xml Mon Oct 29 20:41:00 2012
@@ -35,6 +35,14 @@
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-scheduler-api</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-scheduler-repository</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-repository-layer</artifactId>
       <exclusions>
         <exclusion>
@@ -51,10 +59,10 @@
       <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-repository-scanner</artifactId>
     </dependency>
-    <dependency>
+    <!--dependency>
       <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-scheduler-repository</artifactId>
-    </dependency>
+    </dependency-->
     <dependency>
       <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-proxy-common</artifactId>

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml?rev=1403489&r1=1403488&r2=1403489&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml
(original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml
Mon Oct 29 20:41:00 2012
@@ -47,6 +47,10 @@
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-plexus-bridge</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
       <artifactId>audit</artifactId>
     </dependency>
     <dependency>

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/pom.xml
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/pom.xml?rev=1403489&r1=1403488&r2=1403489&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/pom.xml (original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/pom.xml Mon Oct 29
20:41:00 2012
@@ -76,7 +76,7 @@
       <groupId>org.apache.archiva</groupId>
       <artifactId>metadata-model</artifactId>
     </dependency>
-    <dependency>
+    <!--dependency>
       <groupId>org.apache.archiva</groupId>
       <artifactId>maven2-repository</artifactId>
       <exclusions>
@@ -89,7 +89,7 @@
           <artifactId>log4j</artifactId>
         </exclusion>
       </exclusions>
-    </dependency>
+    </dependency-->
     <dependency>
       <groupId>org.apache.maven.wagon</groupId>
       <artifactId>wagon-http</artifactId>

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/ArchivaDavResourceFactoryTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/ArchivaDavResourceFactoryTest.java?rev=1403489&r1=1403488&r2=1403489&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/ArchivaDavResourceFactoryTest.java
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/ArchivaDavResourceFactoryTest.java
Mon Oct 29 20:41:00 2012
@@ -35,9 +35,6 @@ import org.apache.archiva.configuration.
 import org.apache.archiva.proxy.DefaultRepositoryProxyConnectors;
 import org.apache.archiva.repository.ManagedRepositoryContent;
 import org.apache.archiva.repository.RepositoryContentFactory;
-import org.apache.archiva.repository.content.LegacyPathParser;
-import org.apache.archiva.repository.content.ManagedDefaultRepositoryContent;
-import org.apache.archiva.repository.content.RepositoryRequest;
 import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner;
 import org.apache.commons.io.FileUtils;
 import org.apache.jackrabbit.webdav.DavException;

Modified: archiva/trunk/archiva-modules/metadata/metadata-repository-api/pom.xml
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/metadata/metadata-repository-api/pom.xml?rev=1403489&r1=1403488&r2=1403489&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/metadata/metadata-repository-api/pom.xml (original)
+++ archiva/trunk/archiva-modules/metadata/metadata-repository-api/pom.xml Mon Oct 29 20:41:00
2012
@@ -46,6 +46,10 @@
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-repository-layer</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-repository-admin-api</artifactId>
     </dependency>
     <dependency>
@@ -83,7 +87,10 @@
               javax.inject,
               org.apache.archiva.metadata.model;version=${project.version},
               org.springframework.stereotype;version="[3,4)",
-              org.slf4j;resolution:=optional
+              org.slf4j;resolution:=optional,
+              org.apache.archiva.model,
+              org.apache.archiva.policies,
+              org.apache.archiva.repository
             </Import-Package>
           </instructions>
         </configuration>

Modified: archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryStorage.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryStorage.java?rev=1403489&r1=1403488&r2=1403489&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryStorage.java
(original)
+++ archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryStorage.java
Mon Oct 29 20:41:00 2012
@@ -23,6 +23,9 @@ import org.apache.archiva.metadata.model
 import org.apache.archiva.metadata.model.ProjectMetadata;
 import org.apache.archiva.metadata.model.ProjectVersionMetadata;
 import org.apache.archiva.metadata.repository.filter.Filter;
+import org.apache.archiva.model.ArtifactReference;
+import org.apache.archiva.policies.ProxyDownloadException;
+import org.apache.archiva.repository.ManagedRepositoryContent;
 
 import java.util.Collection;
 
@@ -53,4 +56,7 @@ public interface RepositoryStorage
     // FIXME: reconsider this API, do we want to expose storage format in the form of a path?
     ArtifactMetadata readArtifactMetadataFromPath( String repoId, String path )
         throws RepositoryStorageRuntimeException;
+
+    void applyServerSideRelocation( ManagedRepositoryContent managedRepository, ArtifactReference
artifact )
+        throws ProxyDownloadException;
 }

Modified: archiva/trunk/archiva-modules/metadata/pom.xml
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/metadata/pom.xml?rev=1403489&r1=1403488&r2=1403489&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/metadata/pom.xml (original)
+++ archiva/trunk/archiva-modules/metadata/pom.xml Mon Oct 29 20:41:00 2012
@@ -30,6 +30,7 @@
   <modules>
     <module>metadata-model</module>
     <module>metadata-repository-api</module>
+    <module>metadata-model-maven2</module>
     <module>test-repository</module>
   </modules>
-</project>
+</project>
\ No newline at end of file

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/pom.xml
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/pom.xml?rev=1403489&r1=1403488&r2=1403489&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/pom.xml (original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/pom.xml Mon Oct 29 20:41:00 2012
@@ -34,6 +34,10 @@
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
+      <artifactId>metadata-model-maven2</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
       <artifactId>metadata-repository-api</artifactId>
     </dependency>
     <dependency>
@@ -42,6 +46,10 @@
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-proxy</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
       <artifactId>problem-reports</artifactId>
     </dependency>
     <dependency>
@@ -259,7 +267,13 @@
               org.sonatype.aether.util.artifact,
               net.sf.beanlib.provider.replicator,
               org.apache.archiva.maven2.model,
-              org.sonatype.aether.util.graph.selector
+              org.sonatype.aether.util.graph.selector,
+              org.apache.archiva.metadata.model.maven2,
+              org.apache.archiva.policies,
+              org.apache.archiva.proxy,
+              org.apache.archiva.repository,
+              org.apache.archiva.repository.content,
+              org.apache.archiva.repository.layout
             </Import-Package>
           </instructions>
         </configuration>

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryPathTranslator.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryPathTranslator.java?rev=1403489&r1=1403488&r2=1403489&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryPathTranslator.java
(original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryPathTranslator.java
Mon Oct 29 20:41:00 2012
@@ -20,6 +20,7 @@ package org.apache.archiva.metadata.repo
  */
 
 import org.apache.archiva.metadata.model.ArtifactMetadata;
+import org.apache.archiva.metadata.model.maven2.MavenArtifactFacet;
 import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
 import org.apache.archiva.common.utils.VersionUtil;
 import org.slf4j.Logger;

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java?rev=1403489&r1=1403488&r2=1403489&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java
(original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java
Mon Oct 29 20:41:00 2012
@@ -43,18 +43,24 @@ import org.apache.archiva.metadata.repos
 import org.apache.archiva.metadata.repository.storage.RepositoryStorageMetadataNotFoundException;
 import org.apache.archiva.metadata.repository.storage.RepositoryStorageRuntimeException;
 import org.apache.archiva.model.ArchivaRepositoryMetadata;
+import org.apache.archiva.model.ArtifactReference;
 import org.apache.archiva.model.SnapshotVersion;
+import org.apache.archiva.policies.ProxyDownloadException;
+import org.apache.archiva.proxy.RepositoryProxyConnectors;
 import org.apache.archiva.proxy.common.WagonFactory;
 import org.apache.archiva.reports.RepositoryProblemFacet;
+import org.apache.archiva.repository.ManagedRepositoryContent;
 import org.apache.archiva.xml.XMLException;
 import org.apache.commons.lang.StringUtils;
 import org.apache.maven.model.CiManagement;
 import org.apache.maven.model.Dependency;
+import org.apache.maven.model.DistributionManagement;
 import org.apache.maven.model.IssueManagement;
 import org.apache.maven.model.License;
 import org.apache.maven.model.MailingList;
 import org.apache.maven.model.Model;
 import org.apache.maven.model.Organization;
+import org.apache.maven.model.Relocation;
 import org.apache.maven.model.Scm;
 import org.apache.maven.model.building.DefaultModelBuilderFactory;
 import org.apache.maven.model.building.DefaultModelBuildingRequest;
@@ -62,6 +68,8 @@ import org.apache.maven.model.building.M
 import org.apache.maven.model.building.ModelBuildingException;
 import org.apache.maven.model.building.ModelBuildingRequest;
 import org.apache.maven.model.building.ModelProblem;
+import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
@@ -71,6 +79,7 @@ import javax.inject.Inject;
 import javax.inject.Named;
 import java.io.File;
 import java.io.FileNotFoundException;
+import java.io.FileReader;
 import java.io.FilenameFilter;
 import java.io.IOException;
 import java.util.ArrayList;
@@ -92,7 +101,7 @@ import java.util.Map;
  * within the session in the context of a single managed repository's resolution needs.
  * <p/>
  */
-@Service ("repositoryStorage#maven2")
+@Service ( "repositoryStorage#maven2" )
 public class Maven2RepositoryStorage
     implements RepositoryStorage
 {
@@ -120,18 +129,24 @@ public class Maven2RepositoryStorage
      *
      */
     @Inject
-    @Named (value = "repositoryPathTranslator#maven2")
+    @Named ( value = "repositoryPathTranslator#maven2" )
     private RepositoryPathTranslator pathTranslator;
 
     @Inject
     private WagonFactory wagonFactory;
 
+    @Inject
+    @Named ( value = "repositoryProxyConnectors#default" )
+    private RepositoryProxyConnectors connectors;
+
     private static final Logger log = LoggerFactory.getLogger( Maven2RepositoryStorage.class
);
 
     private static final String METADATA_FILENAME_START = "maven-metadata";
 
     private static final String METADATA_FILENAME = METADATA_FILENAME_START + ".xml";
 
+    private static final MavenXpp3Reader MAVEN_XPP_3_READER = new MavenXpp3Reader();
+
 
     @PostConstruct
     public void initialize()
@@ -614,6 +629,88 @@ public class Maven2RepositoryStorage
         return metadata;
     }
 
+    public void applyServerSideRelocation( ManagedRepositoryContent managedRepository, ArtifactReference
artifact )
+        throws ProxyDownloadException
+    {
+        if ( "pom".equals( artifact.getType() ) )
+        {
+            return;
+        }
+
+        // Build the artifact POM reference
+        ArtifactReference pomReference = new ArtifactReference();
+        pomReference.setGroupId( artifact.getGroupId() );
+        pomReference.setArtifactId( artifact.getArtifactId() );
+        pomReference.setVersion( artifact.getVersion() );
+        pomReference.setType( "pom" );
+
+        // Get the artifact POM from proxied repositories if needed
+        connectors.fetchFromProxies( managedRepository, pomReference );
+
+        // Open and read the POM from the managed repo
+        File pom = managedRepository.toFile( pomReference );
+
+        if ( !pom.exists() )
+        {
+            return;
+        }
+
+        try
+        {
+            // MavenXpp3Reader leaves the file open, so we need to close it ourselves.
+            FileReader reader = new FileReader( pom );
+            Model model = null;
+            try
+            {
+                model = MAVEN_XPP_3_READER.read( reader );
+            }
+            finally
+            {
+                if ( reader != null )
+                {
+                    reader.close();
+                }
+            }
+
+            DistributionManagement dist = model.getDistributionManagement();
+            if ( dist != null )
+            {
+                Relocation relocation = dist.getRelocation();
+                if ( relocation != null )
+                {
+                    // artifact is relocated : update the repositoryPath
+                    if ( relocation.getGroupId() != null )
+                    {
+                        artifact.setGroupId( relocation.getGroupId() );
+                    }
+                    if ( relocation.getArtifactId() != null )
+                    {
+                        artifact.setArtifactId( relocation.getArtifactId() );
+                    }
+                    if ( relocation.getVersion() != null )
+                    {
+                        artifact.setVersion( relocation.getVersion() );
+                    }
+                }
+            }
+        }
+        catch ( FileNotFoundException e )
+        {
+            // Artifact has no POM in repo : ignore
+        }
+        catch ( IOException e )
+        {
+            // Unable to read POM : ignore.
+        }
+        catch ( XmlPullParserException e )
+        {
+            // Invalid POM : ignore
+        }
+    }
+
+    //-----------------------------
+    // internal
+    //-----------------------------
     private static void populateArtifactMetadataFromFile( ArtifactMetadata metadata, File
file )
     {
         metadata.setWhenGathered( new Date() );

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/MavenArtifactFacetFactory.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/MavenArtifactFacetFactory.java?rev=1403489&r1=1403488&r2=1403489&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/MavenArtifactFacetFactory.java
(original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/MavenArtifactFacetFactory.java
Mon Oct 29 20:41:00 2012
@@ -21,6 +21,7 @@ package org.apache.archiva.metadata.repo
 
 import org.apache.archiva.metadata.model.MetadataFacet;
 import org.apache.archiva.metadata.model.MetadataFacetFactory;
+import org.apache.archiva.metadata.model.maven2.MavenArtifactFacet;
 import org.springframework.stereotype.Service;
 
 /**

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/resources/META-INF/spring-context.xml
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/resources/META-INF/spring-context.xml?rev=1403489&r1=1403488&r2=1403489&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/resources/META-INF/spring-context.xml
(original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/resources/META-INF/spring-context.xml
Mon Oct 29 20:41:00 2012
@@ -28,6 +28,7 @@
        default-lazy-init="true">
 
   <context:annotation-config/>
-  <context:component-scan base-package="org.apache.archiva.dependency.tree.maven2,org.apache.archiva.metadata.repository.storage.maven2"/>
+  <context:component-scan base-package="org.apache.archiva.dependency.tree.maven2,org.apache.archiva.metadata.repository.storage.maven2,
+                                        org.apache.archiva.repository.content.maven2"/>
 
 </beans>
\ No newline at end of file

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java?rev=1403489&r1=1403488&r2=1403489&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java
(original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java
Mon Oct 29 20:41:00 2012
@@ -31,6 +31,7 @@ import org.apache.archiva.metadata.model
 import org.apache.archiva.metadata.model.License;
 import org.apache.archiva.metadata.model.MailingList;
 import org.apache.archiva.metadata.model.ProjectVersionMetadata;
+import org.apache.archiva.metadata.model.maven2.MavenArtifactFacet;
 import org.apache.archiva.metadata.repository.filter.AllFilter;
 import org.apache.archiva.metadata.repository.filter.ExcludesFilter;
 import org.apache.archiva.metadata.repository.filter.Filter;

Modified: archiva/trunk/archiva-modules/plugins/repository-statistics/pom.xml
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/repository-statistics/pom.xml?rev=1403489&r1=1403488&r2=1403489&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/repository-statistics/pom.xml (original)
+++ archiva/trunk/archiva-modules/plugins/repository-statistics/pom.xml Mon Oct 29 20:41:00
2012
@@ -33,7 +33,7 @@
       <artifactId>metadata-repository-api</artifactId>
     </dependency>
     <!-- TODO: look at making this optional -->
-    <dependency>
+    <!--dependency>
       <groupId>org.apache.archiva</groupId>
       <artifactId>maven2-repository</artifactId>
       <exclusions>
@@ -46,6 +46,10 @@
           <artifactId>log4j</artifactId>
         </exclusion>
       </exclusions>
+    </dependency-->
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>metadata-model-maven2</artifactId>
     </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>
@@ -106,6 +110,7 @@
               org.apache.archiva.metadata.model;version=${project.version},
               org.apache.archiva.metadata.repository;version=${project.version},
               org.apache.archiva.metadata.repository.storage.maven2;version=${project.version},
+              org.apache.archiva.metadata.model.maven2,
               org.springframework*;version="[3,4)",
               org.slf4j;resolution:=optional
             </Import-Package>

Modified: archiva/trunk/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/DefaultRepositoryStatisticsManager.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/DefaultRepositoryStatisticsManager.java?rev=1403489&r1=1403488&r2=1403489&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/DefaultRepositoryStatisticsManager.java
(original)
+++ archiva/trunk/archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/DefaultRepositoryStatisticsManager.java
Mon Oct 29 20:41:00 2012
@@ -20,10 +20,10 @@ package org.apache.archiva.metadata.repo
  */
 
 import org.apache.archiva.metadata.model.ArtifactMetadata;
+import org.apache.archiva.metadata.model.maven2.MavenArtifactFacet;
 import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.archiva.metadata.repository.MetadataRepositoryException;
 import org.apache.archiva.metadata.repository.MetadataResolutionException;
-import org.apache.archiva.metadata.repository.storage.maven2.MavenArtifactFacet;
 import org.apache.jackrabbit.commons.JcrUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Modified: archiva/trunk/archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/RepositoryStatisticsManagerTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/RepositoryStatisticsManagerTest.java?rev=1403489&r1=1403488&r2=1403489&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/RepositoryStatisticsManagerTest.java
(original)
+++ archiva/trunk/archiva-modules/plugins/repository-statistics/src/test/java/org/apache/archiva/metadata/repository/stats/RepositoryStatisticsManagerTest.java
Mon Oct 29 20:41:00 2012
@@ -21,8 +21,8 @@ package org.apache.archiva.metadata.repo
 
 import junit.framework.TestCase;
 import org.apache.archiva.metadata.model.ArtifactMetadata;
+import org.apache.archiva.metadata.model.maven2.MavenArtifactFacet;
 import org.apache.archiva.metadata.repository.MetadataRepository;
-import org.apache.archiva.metadata.repository.storage.maven2.MavenArtifactFacet;
 import org.easymock.MockControl;
 
 import java.text.SimpleDateFormat;

Modified: archiva/trunk/pom.xml
URL: http://svn.apache.org/viewvc/archiva/trunk/pom.xml?rev=1403489&r1=1403488&r2=1403489&view=diff
==============================================================================
--- archiva/trunk/pom.xml (original)
+++ archiva/trunk/pom.xml Mon Oct 29 20:41:00 2012
@@ -165,6 +165,11 @@
       </dependency>
       <dependency>
         <groupId>org.apache.archiva</groupId>
+        <artifactId>metadata-model-maven2</artifactId>
+        <version>${project.version}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.archiva</groupId>
         <artifactId>archiva-maven2-model</artifactId>
         <version>${project.version}</version>
       </dependency>



Mime
View raw message