--- a/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java Fri Jun 21 08:32:59 2019 -0400
+++ b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Arguments.java Fri Jun 21 10:14:49 2019 -0400
@@ -627,9 +627,6 @@
try {
bundler.validate(localParams);
File result = bundler.execute(localParams, deployParams.outdir);
- if (!userProvidedBuildRoot) {
- bundler.cleanup(localParams);
- }
if (result == null) {
throw new PackagerException("MSG_BundlerFailed",
bundler.getID(), bundler.getName());
@@ -660,6 +657,10 @@
Log.verbose(MessageFormat.format(
I18N.getString("message.debug-working-directory"),
(new File(buildRoot)).getAbsolutePath()));
+ } else {
+ // always clean up the temporary directory created
+ // when --temp-root option not used.
+ bundler.cleanup(localParams);
}
}
}