Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-51302] - Properly cleanup Metadata so that PCT does not miss metadata for running integration tests #28

Merged
merged 1 commit into from May 16, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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