Skip to content

Commit db6f091

Browse files
committed
Revert --enable-monitoring with no arguments support
GraalVM deprecated --enable-monitoring without arguments (see oracle/graal#5792) so there is no need to support the "equivalent" in Quarkus.
1 parent 3a4b19d commit db6f091

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

core/deployment/src/main/java/io/quarkus/deployment/pkg/NativeConfig.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,6 @@ public enum MonitoringOption {
466466
HEAPDUMP,
467467
JVMSTAT,
468468
JFR,
469-
ALL,
470-
TRUE // only needed to support -Dquarkus.native.monitoring
469+
ALL
471470
}
472471
}

core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import java.util.stream.Stream;
2323

2424
import org.apache.commons.lang3.SystemUtils;
25-
import org.eclipse.microprofile.config.ConfigProvider;
2625
import org.jboss.logging.Logger;
2726

2827
import io.quarkus.bootstrap.util.IoUtils;
@@ -830,17 +829,10 @@ public NativeImageInvokerInfo build() {
830829

831830
if (nativeConfig.monitoring.isPresent()) {
832831
List<NativeConfig.MonitoringOption> monitoringOptions = nativeConfig.monitoring.get();
833-
if (monitoringOptions.stream().anyMatch(o -> o == NativeConfig.MonitoringOption.TRUE
834-
|| o == NativeConfig.MonitoringOption.ALL)) {
835-
nativeImageArgs.add("--enable-monitoring");
832+
if (!monitoringOptions.isEmpty()) {
833+
nativeImageArgs.add("--enable-monitoring=" + monitoringOptions.stream()
834+
.map(o -> o.name().toLowerCase(Locale.ROOT)).collect(Collectors.joining(",")));
836835
}
837-
nativeImageArgs
838-
.add("--enable-monitoring=" + monitoringOptions.stream().map(o -> o.name().toLowerCase(
839-
Locale.ROOT)).collect(Collectors.joining(",")));
840-
} else if (ConfigProvider.getConfig().getConfigValue("quarkus.native.monitoring").getValue() != null) {
841-
// this only happens when a user has configured 'quarkus.native.monitoring='
842-
// we want to support this use case as GraalVM allows the use of '--enable-monitoring' without an argument
843-
nativeImageArgs.add("--enable-monitoring");
844836
}
845837
if (nativeConfig.autoServiceLoaderRegistration) {
846838
nativeImageArgs.add("-H:+UseServiceLoaderFeature");

0 commit comments

Comments
 (0)