]> source.dussan.org Git - archiva.git/commitdiff
[MRM-153] handle relocation of artifacts
authorBrett Porter <brett@apache.org>
Fri, 1 Sep 2006 04:21:20 +0000 (04:21 +0000)
committerBrett Porter <brett@apache.org>
Fri, 1 Sep 2006 04:21:20 +0000 (04:21 +0000)
Submitted by: Nicolas de Loof (applied with changes)

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@439168 13f79535-47bb-0310-9956-ffa450edef68

archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultProxyRequestHandler.java
archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ProxyRequestHandlerTest.java
archiva-proxy/src/test/repositories/legacy-managed/org.apache.maven.test/jars/get-default-layout-present-1.0.jar.md5 [new file with mode: 0644]
archiva-proxy/src/test/repositories/legacy-managed/org.apache.maven.test/poms/get-relocated-artefact-1.0.pom [new file with mode: 0644]
archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-layout-present-with-pom/1.0/get-default-layout-present-with-pom-1.0.jar [new file with mode: 0644]
archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-layout-present-with-pom/1.0/get-default-layout-present-with-pom-1.0.pom [new file with mode: 0644]
archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar.md5 [new file with mode: 0644]
archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-doubly-relocated-artefact/1.0/get-doubly-relocated-artefact-1.0.pom [new file with mode: 0644]
archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-relocated-artefact-with-pom/1.0/get-relocated-artefact-with-pom-1.0.pom [new file with mode: 0644]
archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-relocated-artefact/1.0/get-relocated-artefact-1.0.pom [new file with mode: 0644]

index 892fd290cf4a6c6c4e8b073b47a7716549d6aff1..74b0cc1f130253038fb4cacbbf18ac3ee86bb897 100644 (file)
@@ -21,11 +21,16 @@ import org.apache.maven.archiva.digest.DigesterException;
 import org.apache.maven.archiva.discovery.ArtifactDiscoverer;
 import org.apache.maven.archiva.discovery.DiscovererException;
 import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.factory.ArtifactFactory;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
 import org.apache.maven.artifact.repository.metadata.Metadata;
 import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Reader;
 import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Writer;
+import org.apache.maven.model.DistributionManagement;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Relocation;
+import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.wagon.ConnectionException;
 import org.apache.maven.wagon.ResourceDoesNotExistException;
 import org.apache.maven.wagon.TransferFailedException;
@@ -44,6 +49,7 @@ import java.io.File;
 import java.io.FileReader;
 import java.io.FileWriter;
 import java.io.IOException;
+import java.io.Reader;
 import java.security.NoSuchAlgorithmException;
 import java.util.Date;
 import java.util.Iterator;
@@ -67,6 +73,11 @@ public class DefaultProxyRequestHandler
     extends AbstractLogEnabled
     implements ProxyRequestHandler
 {
+    /**
+     * @plexus.requirement
+     */
+    private ArtifactFactory factory;
+
     /**
      * @plexus.requirement role-hint="default"
      * @todo use a map, and have priorities in them
@@ -114,17 +125,74 @@ public class DefaultProxyRequestHandler
     {
         File target = new File( managedRepository.getBasedir(), path );
 
-        for ( Iterator i = proxiedRepositories.iterator(); i.hasNext(); )
+        if ( path.endsWith( "maven-metadata.xml" ) )
         {
-            ProxiedArtifactRepository repository = (ProxiedArtifactRepository) i.next();
+            // Request for managed repository metadatas
+            getMetadata( path, target, proxiedRepositories, managedRepository, wagonProxy, force );
+        }
+        else
+        {
+            boolean checksum = false;
+            String checksumExtension = null;
+            String artifactPath = path;
+            if ( path.endsWith( ".md5" ) || path.endsWith( ".sha1" ) )
+            {
+                int index = path.lastIndexOf( '.' );
+                checksumExtension = path.substring( index + 1 );
+                checksum = true;
+                artifactPath = path.substring( 0, index );
+            }
 
-            if ( !force && repository.isCachedFailure( path ) )
+            // Request for artifact: parse the requested path to build an Artifact.
+            Artifact artifact = null;
+            try
             {
-                processCachedRepositoryFailure( repository, "Cached failure found for: " + path );
+                artifact = defaultArtifactDiscoverer.buildArtifact( artifactPath );
             }
-            else
+            catch ( DiscovererException e )
+            {
+                getLogger().debug( "Failed to build artifact using default layout with message: " + e.getMessage() );
+            }
+
+            if ( artifact == null )
+            {
+                try
+                {
+                    artifact = legacyArtifactDiscoverer.buildArtifact( artifactPath );
+                }
+                catch ( DiscovererException e )
+                {
+                    getLogger().debug( "Failed to build artifact using legacy layout with message: " + e.getMessage() );
+                }
+            }
+
+            if ( artifact != null )
+            {
+                applyRelocation( managedRepository, artifact, proxiedRepositories, wagonProxy, force );
+
+                if ( !checksum )
+                {
+                    // Build the target file name
+                    target = new File( managedRepository.getBasedir(), managedRepository.pathOf( artifact ) );
+
+                    // Get the requested artifact from proxiedRepositories
+                    getArtifactFromRepository( managedRepository, target, artifact, proxiedRepositories, wagonProxy,
+                                               force );
+                }
+                else
+                {
+                    // Just adjust the filename for relocation, don't actualy get it
+                    target = new File( managedRepository.getBasedir(),
+                                       managedRepository.pathOf( artifact ) + "." + checksumExtension );
+                }
+            }
+            else if ( !checksum )
             {
-                target = get( path, target, repository, managedRepository, wagonProxy, force );
+                // Some other unknown file in the repository, proxy as is, unless it was a checksum
+                if ( force || !target.exists() )
+                {
+                    getFileFromRepository( managedRepository, target, path, proxiedRepositories, wagonProxy, force );
+                }
             }
         }
 
@@ -136,104 +204,178 @@ public class DefaultProxyRequestHandler
         return target;
     }
 
-    /**
-     * @return the target File may not be same as the target argument, if a
-     *         maven1 to maven2 path convertion occured.
-     */
-    private File get( String path, File target, ProxiedArtifactRepository repository,
-                      ArtifactRepository managedRepository, ProxyInfo wagonProxy, boolean force )
-        throws ProxyException
+    private void getFileFromRepository( ArtifactRepository managedRepository, File target, String path,
+                                        List proxiedRepositories, ProxyInfo wagonProxy, boolean force )
+        throws ProxyException, ResourceDoesNotExistException
     {
-        ArtifactRepositoryPolicy policy;
-
-        if ( path.endsWith( ".md5" ) || path.endsWith( ".sha1" ) )
+        for ( Iterator i = proxiedRepositories.iterator(); i.hasNext(); )
         {
-            // always read from the managed repository, no need to make remote request
+            ProxiedArtifactRepository repository = (ProxiedArtifactRepository) i.next();
+
+            if ( !force && repository.isCachedFailure( path ) )
+            {
+                processCachedRepositoryFailure( repository, "Cached failure found for: " + path );
+            }
+            else
+            {
+                ArtifactRepositoryPolicy policy = repository.getRepository().getReleases();
+                getFileFromRepository( path, repository, managedRepository.getBasedir(), wagonProxy, target, policy,
+                                       force );
+            }
         }
-        else if ( path.endsWith( "maven-metadata.xml" ) )
-        {
-            File metadataFile = new File( target.getParentFile(), ".metadata-" + repository.getRepository().getId() );
+    }
 
-            policy = repository.getRepository().getReleases();
+    private void getArtifactFromRepository( ArtifactRepository managedRepository, File target, Artifact artifact,
+                                            List proxiedRepositories, ProxyInfo wagonProxy, boolean force )
+        throws ProxyException, ResourceDoesNotExistException
+    {
+        for ( Iterator i = proxiedRepositories.iterator(); i.hasNext(); )
+        {
+            ProxiedArtifactRepository repository = (ProxiedArtifactRepository) i.next();
+            String path = repository.getRepository().getLayout().pathOf( artifact );
 
-            // if it is snapshot metadata, use a different policy
-            if ( path.endsWith( "-SNAPSHOT/maven-metadata.xml" ) )
+            if ( !force && repository.isCachedFailure( path ) )
             {
-                policy = repository.getRepository().getSnapshots();
+                processCachedRepositoryFailure( repository, "Cached failure found for: " + path );
             }
-
-            if ( force || !metadataFile.exists() || isOutOfDate( policy, metadataFile ) )
+            else
             {
-                getFileFromRepository( path, repository, managedRepository.getBasedir(), wagonProxy, metadataFile,
-                                       policy, force );
-
-                mergeMetadataFiles( target, metadataFile );
+                get( artifact, target, repository, managedRepository, wagonProxy, force );
             }
         }
-        else
+    }
+
+    private void applyRelocation( ArtifactRepository managedRepository, Artifact artifact, List proxiedRepositories,
+                                  ProxyInfo wagonProxy, boolean force )
+    {
+        Artifact pomArtifact =
+            factory.createProjectArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion() );
+
+        File pomFile = new File( managedRepository.getBasedir(), managedRepository.pathOf( pomArtifact ) );
+        try
         {
-            Artifact artifact = null;
+            getArtifactFromRepository( managedRepository, pomFile, pomArtifact, proxiedRepositories, wagonProxy,
+                                       force );
+        }
+        catch ( ProxyException e )
+        {
+            getLogger().warn( "Error getting POM for artifact - not relocating: " + e.getMessage() );
+            getLogger().debug( "Cause", e );
+        }
+        catch ( ResourceDoesNotExistException e )
+        {
+            getLogger().debug( "Remote POM not found for artifact - not relocating" );
+        }
+
+        if ( pomFile.exists() )
+        {
+            Model model = null;
             try
             {
-                artifact = defaultArtifactDiscoverer.buildArtifact( path );
+                // Parse the pom and look at relocation metadata
+                Reader reader = new FileReader( pomFile );
+                model = new MavenXpp3Reader().read( reader );
             }
-            catch ( DiscovererException e )
+            catch ( IOException e )
             {
-                getLogger().debug( "Failed to build artifact using default layout with message: " + e.getMessage() );
+                getLogger().warn( "Error reading POM for artifact - not relocating: " + e.getMessage() );
+                getLogger().debug( "Cause", e );
             }
-
-            if ( artifact == null )
+            catch ( XmlPullParserException e )
             {
-                try
-                {
-                    artifact = legacyArtifactDiscoverer.buildArtifact( path );
-                }
-                catch ( DiscovererException e )
-                {
-                    getLogger().debug( "Failed to build artifact using legacy layout with message: " + e.getMessage() );
-                }
+                getLogger().warn( "Error parsing POM for artifact - not relocating: " + e.getMessage() );
+                getLogger().debug( "Cause", e );
             }
 
-            if ( artifact != null )
+            if ( model != null )
             {
-                target = new File( managedRepository.getBasedir(), managedRepository.pathOf( artifact ) );
+                DistributionManagement dist;
+                dist = model.getDistributionManagement();
 
-                ArtifactRepository artifactRepository = repository.getRepository();
+                if ( dist != null )
+                {
+                    Relocation relocation = dist.getRelocation();
+                    if ( relocation != null )
+                    {
+                        String requestedId =
+                            artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + artifact.getVersion();
 
-                // we use the release policy for tracking failures, but only check for updates on snapshots
-                // also, we don't look for updates on timestamp snapshot files, only non-unique-version ones
-                policy = artifact.isSnapshot() ? artifactRepository.getSnapshots() : artifactRepository.getReleases();
+                        // artifact is relocated : update the artifact
+                        if ( relocation.getGroupId() != null )
+                        {
+                            artifact.setGroupId( relocation.getGroupId() );
+                        }
+                        if ( relocation.getArtifactId() != null )
+                        {
+                            artifact.setArtifactId( relocation.getArtifactId() );
+                        }
+                        if ( relocation.getVersion() != null )
+                        {
+                            artifact.setVersion( relocation.getVersion() );
+                        }
 
-                boolean needsUpdate = false;
-                if ( artifact.getVersion().endsWith( "-SNAPSHOT" ) && isOutOfDate( policy, target ) )
-                {
-                    needsUpdate = true;
-                }
+                        String relocatedId =
+                            artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + artifact.getVersion();
 
-                if ( needsUpdate || force || !target.exists() )
-                {
-                    getFileFromRepository( artifactRepository.pathOf( artifact ), repository,
-                                           managedRepository.getBasedir(), wagonProxy, target, policy, force );
+                        getLogger().debug( "Artifact " + requestedId + " has been relocated to " + relocatedId +
+                            ( relocation.getMessage() != null ? ": " + relocation.getMessage() : "" ) );
+
+                        applyRelocation( managedRepository, artifact, proxiedRepositories, wagonProxy, force );
+                    }
                 }
             }
-            else
+        }
+    }
+
+    private void getMetadata( String path, File target, List proxiedRepositories, ArtifactRepository managedRepository,
+                              ProxyInfo wagonProxy, boolean force )
+        throws ProxyException
+    {
+        for ( Iterator i = proxiedRepositories.iterator(); i.hasNext(); )
+        {
+            ProxiedArtifactRepository repository = (ProxiedArtifactRepository) i.next();
+            File metadataFile = new File( target.getParentFile(), ".metadata-" + repository.getRepository().getId() );
+
+            ArtifactRepositoryPolicy policy = repository.getRepository().getReleases();
+
+            // if it is snapshot metadata, use a different policy
+            if ( path.endsWith( "-SNAPSHOT/maven-metadata.xml" ) )
             {
-                // Some other unknown file in the repository, proxy as is
-                if ( force || !target.exists() )
-                {
-                    policy = repository.getRepository().getReleases();
-                    getFileFromRepository( path, repository, managedRepository.getBasedir(), wagonProxy, target, policy,
-                                           force );
-                }
+                policy = repository.getRepository().getSnapshots();
+            }
+
+            if ( force || !metadataFile.exists() || isOutOfDate( policy, metadataFile ) )
+            {
+                getFileFromRepository( path, repository, managedRepository.getBasedir(), wagonProxy, metadataFile,
+                                       policy, force );
+
+                mergeMetadataFiles( target, metadataFile );
             }
         }
+    }
 
-        if ( target.exists() )
+    private void get( Artifact artifact, File target, ProxiedArtifactRepository repository,
+                      ArtifactRepository managedRepository, ProxyInfo wagonProxy, boolean force )
+        throws ProxyException
+    {
+        ArtifactRepository artifactRepository = repository.getRepository();
+
+        // we use the release policy for tracking failures, but only check for updates on snapshots
+        // also, we don't look for updates on timestamp snapshot files, only non-unique-version ones
+        ArtifactRepositoryPolicy policy =
+            artifact.isSnapshot() ? artifactRepository.getSnapshots() : artifactRepository.getReleases();
+
+        boolean needsUpdate = false;
+        if ( artifact.getVersion().endsWith( "-SNAPSHOT" ) && isOutOfDate( policy, target ) )
         {
-            // in case it previously failed and we've since found it
-            repository.clearFailure( path );
+            needsUpdate = true;
+        }
+
+        if ( needsUpdate || force || !target.exists() )
+        {
+            getFileFromRepository( artifactRepository.pathOf( artifact ), repository, managedRepository.getBasedir(),
+                                   wagonProxy, target, policy, force );
         }
-        return target;
     }
 
     private void mergeMetadataFiles( File target, File metadataFile )
@@ -525,10 +667,11 @@ public class DefaultProxyRequestHandler
                                                                    checksumExt.toUpperCase(),
                                                                    path.substring( path.lastIndexOf( '/' ) ) );
 
-                String actualChecksum = checksum.getActualChecksum().toUpperCase();
+                String actualChecksum = checksum.getActualChecksum();
+
                 remoteChecksum = remoteChecksum.toUpperCase();
 
-                if ( remoteChecksum.equals( actualChecksum ) )
+                if ( actualChecksum != null && remoteChecksum.equals( actualChecksum.toUpperCase() ) )
                 {
                     moveTempToTarget( tempChecksumFile, checksumFile );
 
index a1c9da8ffd35146fd77bcc113bdea1efbc9be6ed..c82a9bfc593cd873b515000c32ffa6352565db77 100644 (file)
@@ -1624,6 +1624,136 @@ public class ProxyRequestHandlerTest
         assertEquals( "Check file matches", expectedFile, file );
     }
 
+    public void testRelocateMaven1Request()
+        throws IOException, ResourceDoesNotExistException, ProxyException
+    {
+        String path = "org.apache.maven.test/jars/get-relocated-artefact-1.0.jar";
+        String relocatedPath =
+            "org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar";
+        File expectedFile = new File( defaultManagedRepository.getBasedir(), relocatedPath );
+
+        assertTrue( expectedFile.exists() );
+
+        File file = requestHandler.get( path, proxiedRepositories, defaultManagedRepository );
+
+        assertEquals( "Check file matches", expectedFile, file );
+    }
+
+    public void testDoublyRelocateMaven1Request()
+        throws IOException, ResourceDoesNotExistException, ProxyException
+    {
+        String path = "org.apache.maven.test/jars/get-doubly-relocated-artefact-1.0.jar";
+        String relocatedPath =
+            "org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar";
+        File expectedFile = new File( defaultManagedRepository.getBasedir(), relocatedPath );
+
+        assertTrue( expectedFile.exists() );
+
+        File file = requestHandler.get( path, proxiedRepositories, defaultManagedRepository );
+
+        assertEquals( "Check file matches", expectedFile, file );
+    }
+
+    public void testRelocateMaven1PomRequest()
+        throws IOException, ResourceDoesNotExistException, ProxyException
+    {
+        String path = "org.apache.maven.test/poms/get-relocated-artefact-with-pom-1.0.pom";
+        String relocatedPath =
+            "org/apache/maven/test/get-default-layout-present-with-pom/1.0/get-default-layout-present-with-pom-1.0.pom";
+        File expectedFile = new File( defaultManagedRepository.getBasedir(), relocatedPath );
+
+        assertTrue( expectedFile.exists() );
+
+        File file = requestHandler.get( path, proxiedRepositories, defaultManagedRepository );
+
+        assertEquals( "Check file matches", expectedFile, file );
+
+        assertTrue( expectedFile.exists() );
+    }
+
+    public void testRelocateMaven1PomRequestMissingTarget()
+        throws IOException, ResourceDoesNotExistException, ProxyException
+    {
+        String path = "org.apache.maven.test/poms/get-relocated-artefact-1.0.pom";
+        String relocatedPath =
+            "org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.pom";
+        File expectedFile = new File( defaultManagedRepository.getBasedir(), relocatedPath );
+
+        assertFalse( expectedFile.exists() );
+
+        try
+        {
+            requestHandler.get( path, proxiedRepositories, defaultManagedRepository );
+            fail( "Should have failed to find target POM" );
+        }
+        catch ( ResourceDoesNotExistException e )
+        {
+            assertTrue( true );
+        }
+    }
+
+    public void testRelocateMaven1ChecksumRequest()
+        throws IOException, ResourceDoesNotExistException, ProxyException
+    {
+        String path = "org.apache.maven.test/jars/get-relocated-artefact-1.0.jar.md5";
+        String relocatedPath =
+            "org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar.md5";
+        File expectedFile = new File( defaultManagedRepository.getBasedir(), relocatedPath );
+
+        assertTrue( expectedFile.exists() );
+
+        File file = requestHandler.get( path, proxiedRepositories, defaultManagedRepository );
+
+        assertEquals( "Check file matches", expectedFile, file );
+
+        assertTrue( expectedFile.exists() );
+
+        path = "org.apache.maven.test/jars/get-relocated-artefact-1.0.jar.sha1";
+        relocatedPath = "org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar.sha1";
+        expectedFile = new File( defaultManagedRepository.getBasedir(), relocatedPath );
+
+        assertFalse( expectedFile.exists() );
+
+        try
+        {
+            requestHandler.get( path, proxiedRepositories, defaultManagedRepository );
+            fail( "Checksum was not present, should not be found" );
+        }
+        catch ( ResourceDoesNotExistException e )
+        {
+            assertTrue( true );
+        }
+    }
+
+    public void testRelocateMaven2Request()
+        throws IOException, ResourceDoesNotExistException, ProxyException
+    {
+        String path = "org/apache/maven/test/get-relocated-artefact/1.0/get-relocated-artefact-1.0.jar";
+        String relocatedPath =
+            "org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar";
+        File expectedFile = new File( defaultManagedRepository.getBasedir(), relocatedPath );
+
+        assertTrue( expectedFile.exists() );
+
+        File file = requestHandler.get( path, proxiedRepositories, defaultManagedRepository );
+
+        assertEquals( "Check file matches", expectedFile, file );
+    }
+
+    public void testRelocateMaven2RequestInLegacyManagedRepo()
+        throws IOException, ResourceDoesNotExistException, ProxyException
+    {
+        String path = "org/apache/maven/test/get-relocated-artefact/1.0/get-relocated-artefact-1.0.jar";
+        String relocatedPath = "org.apache.maven.test/jars/get-default-layout-present-1.0.jar";
+        File expectedFile = new File( legacyManagedRepository.getBasedir(), relocatedPath );
+
+        assertTrue( expectedFile.exists() );
+
+        File file = requestHandler.get( path, proxiedRepositories, legacyManagedRepository );
+
+        assertEquals( "Check file matches", expectedFile, file );
+    }
+
     private static Versioning getVersioning( List versions )
     {
         Versioning versioning = new Versioning();
diff --git a/archiva-proxy/src/test/repositories/legacy-managed/org.apache.maven.test/jars/get-default-layout-present-1.0.jar.md5 b/archiva-proxy/src/test/repositories/legacy-managed/org.apache.maven.test/jars/get-default-layout-present-1.0.jar.md5
new file mode 100644 (file)
index 0000000..b597d8c
--- /dev/null
@@ -0,0 +1 @@
+7dfb7ade9a8fa90bfbfac52d3090b8c2 *get-default-layout-present-1.0.jar
diff --git a/archiva-proxy/src/test/repositories/legacy-managed/org.apache.maven.test/poms/get-relocated-artefact-1.0.pom b/archiva-proxy/src/test/repositories/legacy-managed/org.apache.maven.test/poms/get-relocated-artefact-1.0.pom
new file mode 100644 (file)
index 0000000..a1f78ac
--- /dev/null
@@ -0,0 +1,29 @@
+<!--
+  ~ Copyright 2005-2006 The Apache Software Foundation.
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.test</groupId>
+  <artifactId>get-relocated-artefact</artifactId>
+  <version>1.0</version>
+
+  <distributionManagement>
+    <relocation>
+      <artifactId>get-default-layout-present</artifactId>
+    </relocation>
+  </distributionManagement>
+
+</project>
\ No newline at end of file
diff --git a/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-layout-present-with-pom/1.0/get-default-layout-present-with-pom-1.0.jar b/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-layout-present-with-pom/1.0/get-default-layout-present-with-pom-1.0.jar
new file mode 100644 (file)
index 0000000..a3b3838
--- /dev/null
@@ -0,0 +1,3 @@
+get-default-layout-present-1.0.jar
+(managed)
+
diff --git a/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-layout-present-with-pom/1.0/get-default-layout-present-with-pom-1.0.pom b/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-layout-present-with-pom/1.0/get-default-layout-present-with-pom-1.0.pom
new file mode 100644 (file)
index 0000000..1806ff0
--- /dev/null
@@ -0,0 +1,21 @@
+<!--
+  ~ Copyright 2005-2006 The Apache Software Foundation.
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<project>
+  <groupId>org.apache.maven.test</groupId>
+  <artifactId>get-default-layout-present-with-pom</artifactId>
+  <version>1.0</version>
+</project>
diff --git a/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar.md5 b/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar.md5
new file mode 100644 (file)
index 0000000..b597d8c
--- /dev/null
@@ -0,0 +1 @@
+7dfb7ade9a8fa90bfbfac52d3090b8c2 *get-default-layout-present-1.0.jar
diff --git a/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-doubly-relocated-artefact/1.0/get-doubly-relocated-artefact-1.0.pom b/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-doubly-relocated-artefact/1.0/get-doubly-relocated-artefact-1.0.pom
new file mode 100644 (file)
index 0000000..fb10d78
--- /dev/null
@@ -0,0 +1,29 @@
+<!--
+  ~ Copyright 2005-2006 The Apache Software Foundation.
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.test</groupId>
+  <artifactId>get-doubly-relocated-artefact</artifactId>
+  <version>1.0</version>
+
+  <distributionManagement>
+    <relocation>
+      <artifactId>get-relocated-artefact</artifactId>
+    </relocation>
+  </distributionManagement>
+
+</project>
\ No newline at end of file
diff --git a/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-relocated-artefact-with-pom/1.0/get-relocated-artefact-with-pom-1.0.pom b/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-relocated-artefact-with-pom/1.0/get-relocated-artefact-with-pom-1.0.pom
new file mode 100644 (file)
index 0000000..dd65f7b
--- /dev/null
@@ -0,0 +1,29 @@
+<!--
+  ~ Copyright 2005-2006 The Apache Software Foundation.
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.test</groupId>
+  <artifactId>get-relocated-artefact-with-pom</artifactId>
+  <version>1.0</version>
+
+  <distributionManagement>
+    <relocation>
+      <artifactId>get-default-layout-present-with-pom</artifactId>
+    </relocation>
+  </distributionManagement>
+
+</project>
\ No newline at end of file
diff --git a/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-relocated-artefact/1.0/get-relocated-artefact-1.0.pom b/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-relocated-artefact/1.0/get-relocated-artefact-1.0.pom
new file mode 100644 (file)
index 0000000..48513de
--- /dev/null
@@ -0,0 +1,13 @@
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.test</groupId>
+  <artifactId>get-relocated-artefact</artifactId>
+  <version>1.0</version>
+
+  <distributionManagement>
+    <relocation>
+      <artifactId>get-default-layout-present</artifactId>
+    </relocation>
+  </distributionManagement>
+
+</project>
\ No newline at end of file