Skip to content

Commit

Permalink
Fix package type system property clearing
Browse files Browse the repository at this point in the history
(cherry picked from commit 690244b)
  • Loading branch information
aloubyansky authored and gsmet committed Aug 16, 2023
1 parent dba2a10 commit 2d12ce1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ protected void doExecute() throws MojoExecutionException {
// Essentially what this does is to enable the native package type even if a different package type is set
// in application properties. This is done to preserve what users expect to happen when
// they execute "mvn package -Dnative" even if quarkus.package.type has been set in application.properties
if (!setPackageTypeSystemPropertyIfNativeProfileEnabled()) {
if (setPackageTypeSystemPropertyIfNativeProfileEnabled()) {
propertiesToClear.add(PACKAGE_TYPE_PROP);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ protected void doExecute() throws MojoExecutionException, MojoFailureException {
} catch (Exception any) {
throw new MojoExecutionException("Failed to bootstrap Quarkus application", any);
} finally {
System.clearProperty(PACKAGE_TYPE_PROP);
if (clearPackageTypeSystemProperty) {
System.clearProperty(PACKAGE_TYPE_PROP);
}
Thread.currentThread().setContextClassLoader(originalCl);
if (deploymentClassLoader != null) {
deploymentClassLoader.close();
Expand Down

0 comments on commit 2d12ce1

Please sign in to comment.