Skip to content
Permalink
Browse files
[JENKINS-51302] - Properly cleanup Metadata so that PCT does not miss…
… metadata for running integration tests
  • Loading branch information
oleg-nenashev committed May 14, 2018
1 parent 615fb7d commit 9a011d96e759c400cab79fc7edb640c75aeee63b
Showing 1 changed file with 10 additions and 4 deletions.
@@ -84,13 +84,19 @@ private void explode(@Nonnull Set<String> excludes) throws IOException {
}

public JenkinsWarPatcher removeMetaInf() throws IOException {
File p = new File(dstDir, "META-INF");
if (p.exists()) {
FileUtils.deleteDirectory(p);
}
deleteMetaINFFiles("MANIFEST.MF", "JENKINS.SF", "JENKINS.RSA");
return this;
}

private void deleteMetaINFFiles(String ... filenames) throws IOException {
for (String filename : filenames) {
File p = new File(dstDir, "META-INF/" + filename);
if (p.exists() && !p.delete()) {
throw new IOException("Failed to delete the metadata file " + p);
}
}
}

private File getLibsDir() {
return new File(dstDir, "WEB-INF/lib");
}

0 comments on commit 9a011d9

Please sign in to comment.