Skip to content

Commit

Permalink
[FIXED JENKINS-9122] - Archived artifacts overridden when having mult…
Browse files Browse the repository at this point in the history
…iple produced artifacts under different paths but with the same file name

Originally-Committed-As: ca56a32e16b97a8dae2e76718144ea00b24f51b1
  • Loading branch information
tomerc-jfrog authored and kohsuke committed Mar 23, 2011
1 parent 995914e commit fe6be8c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/java/hudson/maven/reporters/MavenArtifact.java
Expand Up @@ -101,7 +101,6 @@ public MavenArtifact(Artifact a) throws IOException {
this.version = a.getVersion();
this.classifier = a.getClassifier();
this.type = a.getType();
// TODO: on archive we need to follow the same format as Maven repository
this.fileName = a.getFile().getName();
this.md5sum = Util.getDigestOf(new FileInputStream(a.getFile()));
String extension;
Expand Down Expand Up @@ -180,15 +179,15 @@ private String getSeed(String extension) {
/**
* Obtains the {@link File} representing the archived artifact.
*/
protected File getFile(MavenBuild build) throws IOException {
File f = new File(new File(new File(new File(build.getArtifactsDir(), groupId), artifactId), version), fileName);
public File getFile(MavenBuild build) throws IOException {
File f = new File(new File(new File(new File(build.getArtifactsDir(), groupId), artifactId), version), canonicalName);
if(!f.exists())
throw new IOException("Archived artifact is missing: "+f);
return f;
}

private FilePath getArtifactArchivePath(MavenBuildProxy build, String groupId, String artifactId, String version) {
return build.getArtifactsDir().child(groupId).child(artifactId).child(version).child(fileName);
return build.getArtifactsDir().child(groupId).child(artifactId).child(version).child(canonicalName);
}

/**
Expand Down

0 comments on commit fe6be8c

Please sign in to comment.