diff --git a/src/main/java/hudson/plugins/promoted_builds/CopyListener.java b/src/main/java/hudson/plugins/promoted_builds/CopyListener.java index 983a3139..c2e3c739 100644 --- a/src/main/java/hudson/plugins/promoted_builds/CopyListener.java +++ b/src/main/java/hudson/plugins/promoted_builds/CopyListener.java @@ -37,9 +37,11 @@ public boolean accept(File child) { if (subdirs != null) { prop = ((Job)item).getProperty(JobPropertyImpl.class); for (File subdir : subdirs) try { + File dest = prop.getRootDirFor(subdir.getName()); + Files.createDirectories(dest.toPath()); Files.copy( new File(subdir, "config.xml").toPath(), - new File(prop.getRootDirFor(subdir.getName()), "config.xml").toPath(), + new File(dest, "config.xml").toPath(), StandardCopyOption.REPLACE_EXISTING); } catch (InvalidPathException | IOException e) { Logger.getLogger(CopyListener.class.getName()).log(Level.WARNING,