Skip to content

Commit

Permalink
Merge pull request #28 from oleg-nenashev/JENKINS-51302
Browse files Browse the repository at this point in the history
[JENKINS-51302] - Properly cleanup Metadata so that PCT does not miss metadata for running integration tests
  • Loading branch information
oleg-nenashev committed May 16, 2018
2 parents b9f7d90 + 9a011d9 commit 66768f5
Showing 1 changed file with 10 additions and 4 deletions.
Expand Up @@ -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");
}
Expand Down

0 comments on commit 66768f5

Please sign in to comment.