artifacts = new ArrayList<Artifacts.FullAndPartURIs>(clientArtifactsManager.artifacts());
final String generatedClientJARName = generatedClientJARNameAndType(appName);
final File generatedClientJARFile = new File(deploymentContext.getScratchDir("xml"),
generatedClientJARName);
OutputJarArchive generatedClientJAR = new OutputJarArchive();
try {
try {
generatedClientJAR.create(generatedClientJARFile.toURI());
if ( ! isManifestPresent(artifacts)) {
/*
* Add a simple manifest.
*/
deplLogger.log(Level.FINER, "Adding a simple manifest; one was not already generated");
addManifest(artifacts);
}
copyArtifactsToClientJAR(generatedClientJAR, artifacts);
} finally {
generatedClientJAR.close();
}
} catch (IOException ex) {
if ( ! generatedClientJARFile.delete()) {
generatedClientJARFile.deleteOnExit();
}