提交 ca56a32e 编写于 作者: T Tomer Cohen 提交者: Kohsuke Kawaguchi

[FIXED JENKINS-9122] - Archived artifacts overridden when having multiple...

[FIXED JENKINS-9122] - Archived artifacts overridden when having multiple produced artifacts under different paths but with the same file name
上级 9c8fcf2e
......@@ -101,7 +101,6 @@ public final class MavenArtifact implements Serializable {
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;
......@@ -180,15 +179,15 @@ public final class MavenArtifact implements Serializable {
/**
* 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);
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册