Browse Source

Fixing wrong checksum files of proxy repositories

Fixes https://issues.apache.org/jira/browse/MRM-1926
tags/archiva-2.2.2
Martin Stockhammer 7 years ago
parent
commit
5de7825b42
13 changed files with 32 additions and 5 deletions
  1. 20
    5
      archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java
  2. 1
    0
      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
  3. 1
    0
      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
  4. 1
    0
      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
  5. 1
    0
      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
  6. 1
    0
      archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-parent/1/test-artifact-parent-1.pom.md5
  7. 1
    0
      archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-parent/1/test-artifact-parent-1.pom.sha1
  8. 1
    0
      archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-root/1.0/test-artifact-root-1.0.pom.md5
  9. 1
    0
      archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-root/1.0/test-artifact-root-1.0.pom.sha1
  10. 1
    0
      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
  11. 1
    0
      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
  12. 1
    0
      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
  13. 1
    0
      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

+ 20
- 5
archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/RepositoryModelResolver.java View 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." );


+ 1
- 0
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 View File

@@ -0,0 +1 @@
61a4d030260fc6bee0681cf99ba54674 test-artifact-module-a-1.0.pom

+ 1
- 0
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 View File

@@ -0,0 +1 @@
6f54bc4223bc39d7880420f66baa3a24d7f9c181 test-artifact-module-a-1.0.pom

+ 1
- 0
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 View File

@@ -0,0 +1 @@
daa5fa59239b1a81d7c04aea1c235aad test-artifact-module-b-1.0.pom

+ 1
- 0
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 View File

@@ -0,0 +1 @@
3d0a66ad4f202b823feb367c46c7574cbb0301c8 test-artifact-module-b-1.0.pom

+ 1
- 0
archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-parent/1/test-artifact-parent-1.pom.md5 View File

@@ -0,0 +1 @@
92c60efe85e23fe5afd8a854cea87209 test-artifact-parent-1.pom

+ 1
- 0
archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-parent/1/test-artifact-parent-1.pom.sha1 View File

@@ -0,0 +1 @@
6eca3509acf66023c29e2bc17f73e79d1d1a341a test-artifact-parent-1.pom

+ 1
- 0
archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-root/1.0/test-artifact-root-1.0.pom.md5 View File

@@ -0,0 +1 @@
034449f8696981edce2485b841a02a47 test-artifact-root-1.0.pom

+ 1
- 0
archiva-modules/plugins/maven2-repository/src/test/resources/com/example/test/test-artifact-root/1.0/test-artifact-root-1.0.pom.sha1 View File

@@ -0,0 +1 @@
bef26aec1a0714cec7fa56cdbb7ebcdb452295eb test-artifact-root-1.0.pom

+ 1
- 0
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 View File

@@ -0,0 +1 @@
3b689a3c3cacecdf4371c342606211f1 test-snapshot-artifact-module-a-1.1-SNAPSHOT.pom

+ 1
- 0
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 View File

@@ -0,0 +1 @@
b401e87baeeb0174efd85eaf327d9c98efe79cf1 test-snapshot-artifact-module-a-1.1-SNAPSHOT.pom

+ 1
- 0
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 View File

@@ -0,0 +1 @@
0c304367d7a99291eb8292b1fe7114a2 test-snapshot-artifact-root-1.1-20100310.014828-2.pom

+ 1
- 0
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 View File

@@ -0,0 +1 @@
e5e6ca9ae3628ae474c155619467848dc900b8cf test-snapshot-artifact-root-1.1-20100310.014828-2.pom

Loading…
Cancel
Save