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
  • Loading branch information
tomerc-jfrog authored and kohsuke committed Mar 23, 2011
1 parent 9c8fcf2 commit ca56a32
Showing 1 changed file with 3 additions and 4 deletions.
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

2 comments on commit ca56a32

@elifarley
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change might have caused a bug: https://issues.jenkins-ci.org/browse/JENKINS-9466

@elifarley
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue https://issues.jenkins-ci.org/browse/JENKINS-9466 may have been caused by this commit.

Please sign in to comment.