Skip to content

Commit 0a2ed44

Browse files
committed
e5e95d0 & 8598f5e applied also to LibraryRetriever compat code
1 parent 10155ea commit 0a2ed44

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/org/jenkinsci/plugins/workflow/libs/LibraryRetriever.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
import hudson.util.FormValidation;
3636
import edu.umd.cs.findbugs.annotations.CheckForNull;
3737
import edu.umd.cs.findbugs.annotations.NonNull;
38+
import hudson.slaves.WorkspaceList;
3839
import hudson.util.io.ArchiverFactory;
3940
import java.io.IOException;
4041
import java.io.OutputStream;
@@ -56,12 +57,13 @@ public abstract class LibraryRetriever extends AbstractDescribableImpl<LibraryRe
5657
*/
5758
public void retrieveJar(@NonNull String name, @NonNull String version, boolean changelog, @NonNull FilePath target, @NonNull Run<?,?> run, @NonNull TaskListener listener) throws Exception {
5859
if (Util.isOverridden(LibraryRetriever.class, getClass(), "retrieve", String.class, String.class, boolean.class, FilePath.class, Run.class, TaskListener.class)) {
59-
FilePath tmp = target.withSuffix(".checkout");
60+
FilePath tmp = target.sibling(target.getBaseName() + "-checkout");
6061
try {
6162
retrieve(name, version, changelog, tmp, run, listener);
6263
dir2Jar(tmp, target);
6364
} finally {
6465
tmp.deleteRecursive();
66+
WorkspaceList.tempDir(tmp).deleteRecursive();
6567
}
6668
} else {
6769
throw new AbstractMethodError("Implement retrieveJar");

0 commit comments

Comments
 (0)