]> source.dussan.org Git - archiva.git/commitdiff
Fixing wrong checksum files of proxy repositories
authorMartin Stockhammer <martin_s@apache.org>
Mon, 17 Oct 2016 20:11:57 +0000 (22:11 +0200)
committerMartin Stockhammer <martin_s@apache.org>
Mon, 17 Oct 2016 20:11:57 +0000 (22:11 +0200)
Fixes https://issues.apache.org/jira/browse/MRM-1926

13 files changed:
archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java
archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-module-a/1.0/test-artifact-module-a-1.0.pom.md5 [new file with mode: 0644]
archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-module-a/1.0/test-artifact-module-a-1.0.pom.sha1 [new file with mode: 0644]
archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-module-b/1.0/test-artifact-module-b-1.0.pom.md5 [new file with mode: 0644]
archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-module-b/1.0/test-artifact-module-b-1.0.pom.sha1 [new file with mode: 0644]
archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-parent/1/test-artifact-parent-1.pom.md5 [new file with mode: 0644]
archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-parent/1/test-artifact-parent-1.pom.sha1 [new file with mode: 0644]
archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-root/1.0/test-artifact-root-1.0.pom.md5 [new file with mode: 0644]
archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-root/1.0/test-artifact-root-1.0.pom.sha1 [new file with mode: 0644]
archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-snapshot-artifact-module-a/1.1-SNAPSHOT/test-snapshot-artifact-module-a-1.1-SNAPSHOT.pom.md5 [new file with mode: 0644]
archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-snapshot-artifact-module-a/1.1-SNAPSHOT/test-snapshot-artifact-module-a-1.1-SNAPSHOT.pom.sha1 [new file with mode: 0644]
archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-snapshot-artifact-root/1.1-SNAPSHOT/test-snapshot-artifact-root-1.1-20100310.014828-2.pom.md5 [new file with mode: 0644]
archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-snapshot-artifact-root/1.1-SNAPSHOT/test-snapshot-artifact-root-1.1-20100310.014828-2.pom.sha1 [new file with mode: 0644]

index 0cb92646af4a7b471c0c08f34d103ad0483de3cf..b84a859b9967295ad6393a7574394746ffb88436 100644 (file)
@@ -413,15 +413,30 @@ public class RepositoryModelResolver
         return connected;
     }
 
-    private File transferChecksum( Wagon wagon, RemoteRepository remoteRepository, String remotePath, File resource,
-                                   File tmpDirectory, String ext )
+    /**
+     *
+     * @param wagon The wagon instance that should be connected.
+     * @param remoteRepository The repository from where the checksum file should be retrieved
+     * @param remotePath The remote path of the artifact (without extension)
+     * @param resource The local artifact (without extension)
+     * @param workingDir The working directory where the downloaded file should be placed to
+     * @param ext The extension of th checksum file
+     * @return The file where the data has been downloaded to.
+     * @throws AuthorizationException
+     * @throws TransferFailedException
+     * @throws ResourceDoesNotExistException
+     */
+    private File transferChecksum( final Wagon wagon, final RemoteRepository remoteRepository,
+                                   final String remotePath, final File resource,
+                                   final File workingDir, final String ext )
         throws AuthorizationException, TransferFailedException, ResourceDoesNotExistException
     {
-        File destFile = new File( tmpDirectory, resource.getName() + ext );
+        File destFile = new File( workingDir, resource.getName() + ext );
+        String remoteChecksumPath = remotePath + ext;
 
-        log.info( "Retrieving {} from {}", remotePath, remoteRepository.getName() );
+        log.info( "Retrieving {} from {}", remoteChecksumPath, remoteRepository.getName() );
 
-        wagon.get( addParameters( remotePath, remoteRepository ), destFile );
+        wagon.get( addParameters( remoteChecksumPath, remoteRepository ), destFile );
 
         log.debug( "Downloaded successfully." );
 
diff --git a/archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-module-a/1.0/test-artifact-module-a-1.0.pom.md5 b/archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-module-a/1.0/test-artifact-module-a-1.0.pom.md5
new file mode 100644 (file)
index 0000000..40dc44a
--- /dev/null
@@ -0,0 +1 @@
+61a4d030260fc6bee0681cf99ba54674  test-artifact-module-a-1.0.pom
diff --git a/archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-module-a/1.0/test-artifact-module-a-1.0.pom.sha1 b/archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-module-a/1.0/test-artifact-module-a-1.0.pom.sha1
new file mode 100644 (file)
index 0000000..59d8111
--- /dev/null
@@ -0,0 +1 @@
+6f54bc4223bc39d7880420f66baa3a24d7f9c181  test-artifact-module-a-1.0.pom
diff --git a/archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-module-b/1.0/test-artifact-module-b-1.0.pom.md5 b/archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-module-b/1.0/test-artifact-module-b-1.0.pom.md5
new file mode 100644 (file)
index 0000000..c087db3
--- /dev/null
@@ -0,0 +1 @@
+daa5fa59239b1a81d7c04aea1c235aad  test-artifact-module-b-1.0.pom
diff --git a/archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-module-b/1.0/test-artifact-module-b-1.0.pom.sha1 b/archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-module-b/1.0/test-artifact-module-b-1.0.pom.sha1
new file mode 100644 (file)
index 0000000..3315ef8
--- /dev/null
@@ -0,0 +1 @@
+3d0a66ad4f202b823feb367c46c7574cbb0301c8  test-artifact-module-b-1.0.pom
diff --git a/archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-parent/1/test-artifact-parent-1.pom.md5 b/archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-parent/1/test-artifact-parent-1.pom.md5
new file mode 100644 (file)
index 0000000..98587da
--- /dev/null
@@ -0,0 +1 @@
+92c60efe85e23fe5afd8a854cea87209  test-artifact-parent-1.pom
diff --git a/archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-parent/1/test-artifact-parent-1.pom.sha1 b/archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-parent/1/test-artifact-parent-1.pom.sha1
new file mode 100644 (file)
index 0000000..a0bcb35
--- /dev/null
@@ -0,0 +1 @@
+6eca3509acf66023c29e2bc17f73e79d1d1a341a  test-artifact-parent-1.pom
diff --git a/archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-root/1.0/test-artifact-root-1.0.pom.md5 b/archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-root/1.0/test-artifact-root-1.0.pom.md5
new file mode 100644 (file)
index 0000000..8870d46
--- /dev/null
@@ -0,0 +1 @@
+034449f8696981edce2485b841a02a47  test-artifact-root-1.0.pom
diff --git a/archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-root/1.0/test-artifact-root-1.0.pom.sha1 b/archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-root/1.0/test-artifact-root-1.0.pom.sha1
new file mode 100644 (file)
index 0000000..eba4197
--- /dev/null
@@ -0,0 +1 @@
+bef26aec1a0714cec7fa56cdbb7ebcdb452295eb  test-artifact-root-1.0.pom
diff --git a/archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-snapshot-artifact-module-a/1.1-SNAPSHOT/test-snapshot-artifact-module-a-1.1-SNAPSHOT.pom.md5 b/archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-snapshot-artifact-module-a/1.1-SNAPSHOT/test-snapshot-artifact-module-a-1.1-SNAPSHOT.pom.md5
new file mode 100644 (file)
index 0000000..a36564b
--- /dev/null
@@ -0,0 +1 @@
+3b689a3c3cacecdf4371c342606211f1  test-snapshot-artifact-module-a-1.1-SNAPSHOT.pom
diff --git a/archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-snapshot-artifact-module-a/1.1-SNAPSHOT/test-snapshot-artifact-module-a-1.1-SNAPSHOT.pom.sha1 b/archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-snapshot-artifact-module-a/1.1-SNAPSHOT/test-snapshot-artifact-module-a-1.1-SNAPSHOT.pom.sha1
new file mode 100644 (file)
index 0000000..e9d1ab6
--- /dev/null
@@ -0,0 +1 @@
+b401e87baeeb0174efd85eaf327d9c98efe79cf1  test-snapshot-artifact-module-a-1.1-SNAPSHOT.pom
diff --git a/archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-snapshot-artifact-root/1.1-SNAPSHOT/test-snapshot-artifact-root-1.1-20100310.014828-2.pom.md5 b/archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-snapshot-artifact-root/1.1-SNAPSHOT/test-snapshot-artifact-root-1.1-20100310.014828-2.pom.md5
new file mode 100644 (file)
index 0000000..278e71b
--- /dev/null
@@ -0,0 +1 @@
+0c304367d7a99291eb8292b1fe7114a2  test-snapshot-artifact-root-1.1-20100310.014828-2.pom
diff --git a/archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-snapshot-artifact-root/1.1-SNAPSHOT/test-snapshot-artifact-root-1.1-20100310.014828-2.pom.sha1 b/archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-snapshot-artifact-root/1.1-SNAPSHOT/test-snapshot-artifact-root-1.1-20100310.014828-2.pom.sha1
new file mode 100644 (file)
index 0000000..3fe44e1
--- /dev/null
@@ -0,0 +1 @@
+e5e6ca9ae3628ae474c155619467848dc900b8cf  test-snapshot-artifact-root-1.1-20100310.014828-2.pom