Skip to content

Commit e549cee

Browse files
authored
Merge pull request #50421 from zakkak/2025-10-06-remove-long-deprecated-native-options
Remove long deprecated native configuration options
2 parents 702db71 + 4557b4a commit e549cee

File tree

12 files changed

+20
-278
lines changed

12 files changed

+20
-278
lines changed

core/deployment/src/main/java/io/quarkus/deployment/builditem/nativeimage/ReflectiveClassBuildItem.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import org.jboss.logging.Logger;
99

1010
import io.quarkus.builder.item.MultiBuildItem;
11-
import io.quarkus.runtime.graal.GraalVM;
1211

1312
/**
1413
* Used to register a class for reflection in native mode
@@ -196,15 +195,6 @@ public boolean isQueryConstructors() {
196195
return queryConstructors;
197196
}
198197

199-
/**
200-
* @deprecated As of GraalVM 21.2 finalFieldsWritable is no longer needed when registering fields for reflection. This will
201-
* be removed in a future version of Quarkus.
202-
*/
203-
@Deprecated
204-
public boolean areFinalFieldsWritable() {
205-
return false;
206-
}
207-
208198
public boolean isWeak() {
209199
return weak;
210200
}
@@ -335,15 +325,6 @@ public Builder classes() {
335325
return classes(true);
336326
}
337327

338-
/**
339-
* @deprecated As of GraalVM 21.2 finalFieldsWritable is no longer needed when registering fields for reflection. This
340-
* will be removed in a future version of Quarkus.
341-
*/
342-
@Deprecated(forRemoval = true)
343-
public Builder finalFieldsWritable(boolean finalFieldsWritable) {
344-
return this;
345-
}
346-
347328
public Builder weak(boolean weak) {
348329
this.weak = weak;
349330
return this;

core/deployment/src/main/java/io/quarkus/deployment/builditem/nativeimage/ReflectiveClassFinalFieldsWritablePredicateBuildItem.java

Lines changed: 0 additions & 26 deletions
This file was deleted.

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

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -64,62 +64,13 @@ public interface NativeConfig {
6464
@WithDefault("false")
6565
boolean enableHttpsUrlHandler();
6666

67-
/**
68-
* If all security services should be added to the native image
69-
*
70-
* @deprecated {@code --enable-all-security-services} was removed in GraalVM 21.1 https://github.com/oracle/graal/pull/3258
71-
*/
72-
@WithDefault("false")
73-
@Deprecated
74-
boolean enableAllSecurityServices();
75-
76-
/**
77-
* If {@code -H:+InlineBeforeAnalysis} flag will be added to the native-image run
78-
*
79-
* @deprecated inlineBeforeAnalysis is always enabled starting from GraalVM 21.3.
80-
*/
81-
@Deprecated
82-
@WithDefault("true")
83-
boolean inlineBeforeAnalysis();
84-
85-
/**
86-
* @deprecated JNI is always enabled starting from GraalVM 19.3.1.
87-
*/
88-
@Deprecated
89-
@WithDefault("true")
90-
boolean enableJni();
91-
9267
/**
9368
* The default value for java.awt.headless JVM option.
9469
* Switching this option affects linking of awt libraries.
9570
*/
9671
@WithDefault("true")
9772
boolean headless();
9873

99-
/**
100-
* Defines the user language used for building the native executable.
101-
* With GraalVM versions prior to GraalVM for JDK 24 it also serves as the default Locale language for the native executable
102-
* application runtime.
103-
* e.g. en or cs as defined by IETF BCP 47 language tags.
104-
* <p>
105-
*
106-
* @deprecated Use the global quarkus.default-locale.
107-
*/
108-
@Deprecated
109-
Optional<@WithConverter(TrimmedStringConverter.class) String> userLanguage();
110-
111-
/**
112-
* Defines the user country used for building the native executable.
113-
* With GraalVM versions prior to GraalVM for JDK 24 it also serves as the default Locale country for the native executable
114-
* application runtime.
115-
* e.g. US or FR as defined by ISO 3166-1 alpha-2 codes.
116-
* <p>
117-
*
118-
* @deprecated Use the global quarkus.default-locale.
119-
*/
120-
@Deprecated
121-
Optional<@WithConverter(TrimmedStringConverter.class) String> userCountry();
122-
12374
/**
12475
* Defines the file encoding as in {@code -Dfile.encoding=...}.
12576
* <p>
@@ -173,16 +124,6 @@ public interface NativeConfig {
173124
@WithDefault("true")
174125
boolean publishDebugBuildProcessPort();
175126

176-
/**
177-
* If the native image server should be restarted.
178-
*
179-
* @deprecated Since GraalVM 20.2.0 the native image server has become an experimental feature and is disabled by
180-
* default.
181-
*/
182-
@Deprecated
183-
@WithDefault("false")
184-
boolean cleanupServer();
185-
186127
/**
187128
* If isolates should be enabled
188129
*/
@@ -196,18 +137,6 @@ public interface NativeConfig {
196137
@WithDefault("false")
197138
boolean enableFallbackImages();
198139

199-
/**
200-
* If the native image server should be used. This can speed up compilation but can result in changes not always
201-
* being picked up due to cache invalidation not working 100%
202-
*
203-
* @deprecated This used to be the default prior to GraalVM 20.2.0 and this configuration item was used to disable
204-
* it as it was not stable. Since GraalVM 20.2.0 the native image server has become an experimental
205-
* feature.
206-
*/
207-
@Deprecated
208-
@WithDefault("false")
209-
boolean enableServer();
210-
211140
/**
212141
* If all META-INF/services entries should be automatically registered
213142
*/
@@ -339,15 +268,6 @@ default String getEffectiveImage() {
339268
*/
340269
Optional<List<MonitoringOption>> monitoring();
341270

342-
/**
343-
* If full stack traces are enabled in the resulting image
344-
*
345-
* @deprecated GraalVM 23.1+ will always build with full stack traces.
346-
*/
347-
@WithDefault("true")
348-
@Deprecated
349-
boolean fullStackTraces();
350-
351271
/**
352272
* If the reports on call paths and included packages/classes/methods should be generated
353273
*/

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

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -246,14 +246,6 @@ public NativeImageBuildItem build(NativeConfig nativeConfig, LocalesBuildTimeCon
246246
checkGraalVMVersion(graalVMVersion);
247247

248248
try {
249-
if (nativeConfig.cleanupServer()) {
250-
log.warn(
251-
"Your application is setting the deprecated 'quarkus.native.cleanup-server' configuration key"
252-
+ " to true. Please consider removing this configuration key as it is ignored"
253-
+ " (The Native image build server is always disabled) and it will be removed in a"
254-
+ " future Quarkus version.");
255-
}
256-
257249
NativeImageInvokerInfo commandAndExecutable = new NativeImageInvokerInfo.Builder()
258250
.setNativeConfig(nativeConfig)
259251
.setLocalesBuildTimeConfig(localesBuildTimeConfig)
@@ -717,7 +709,6 @@ public Builder setNativeMonitoringOptions(List<NativeMonitoringBuildItem> option
717709
public NativeImageInvokerInfo build() {
718710
List<String> nativeImageArgs = new ArrayList<>();
719711
boolean enableSslNative = false;
720-
boolean inlineBeforeAnalysis = nativeConfig.inlineBeforeAnalysis();
721712
boolean addAllCharsets = nativeConfig.addAllCharsets();
722713
boolean enableHttpsUrlHandler = nativeConfig.enableHttpsUrlHandler();
723714
for (NativeImageSystemPropertyBuildItem prop : nativeImageProperties) {
@@ -735,8 +726,6 @@ public NativeImageInvokerInfo build() {
735726
+ " will be removed in a future Quarkus version.");
736727
} else if (prop.getKey().equals("quarkus.native.enable-all-charsets") && prop.getValue() != null) {
737728
addAllCharsets |= Boolean.parseBoolean(prop.getValue());
738-
} else if (prop.getKey().equals("quarkus.native.inline-before-analysis") && prop.getValue() != null) {
739-
inlineBeforeAnalysis = Boolean.parseBoolean(prop.getValue());
740729
} else {
741730
// todo maybe just -D is better than -J-D in this case
742731
if (prop.getValue() == null) {
@@ -919,29 +908,13 @@ public NativeImageInvokerInfo build() {
919908
if (!protocols.isEmpty()) {
920909
nativeImageArgs.add("--enable-url-protocols=" + String.join(",", protocols));
921910
}
922-
if (!inlineBeforeAnalysis) {
923-
addExperimentalVMOption(nativeImageArgs, "-H:-InlineBeforeAnalysis");
924-
}
925911
if (!pie.isEmpty()) {
926912
nativeImageArgs.add("-H:NativeLinkerOption=" + pie);
927913
}
928914

929915
if (!nativeConfig.enableIsolates()) {
930916
addExperimentalVMOption(nativeImageArgs, "-H:-SpawnIsolates");
931917
}
932-
if (!nativeConfig.enableJni()) {
933-
log.warn(
934-
"Your application is setting the deprecated 'quarkus.native.enable-jni' configuration key to false."
935-
+ " Please consider removing this configuration key as it is ignored (JNI is always enabled) and it"
936-
+ " will be removed in a future Quarkus version.");
937-
}
938-
if (nativeConfig.enableServer()) {
939-
log.warn(
940-
"Your application is setting the deprecated 'quarkus.native.enable-server' configuration key to true."
941-
+ " Please consider removing this configuration key as it is ignored"
942-
+ " (The Native image build server is always disabled) and it"
943-
+ " will be removed in a future Quarkus version.");
944-
}
945918
if (nativeConfig.enableVmInspection()) {
946919
addExperimentalVMOption(nativeImageArgs, "-H:+AllowVMInspection");
947920
}

core/deployment/src/main/java/io/quarkus/deployment/steps/LocaleProcessor.java

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@
2828
public class LocaleProcessor {
2929

3030
private static final Logger log = Logger.getLogger(LocaleProcessor.class);
31-
public static final String DEPRECATED_USER_LANGUAGE_WARNING = "Your application is setting the deprecated 'quarkus.native.user-language' configuration property. "
32-
+
33-
"Please, consider using only 'quarkus.default-locale' configuration property instead.";
34-
public static final String DEPRECATED_USER_COUNTRY_WARNING = "Your application is setting the deprecated 'quarkus.native.user-country' configuration property. "
35-
+
36-
"Please, consider using only 'quarkus.default-locale' configuration property instead.";
3731

3832
@BuildStep(onlyIf = { NativeBuild.class, NonDefaultLocale.class })
3933
void nativeResources(BuildProducer<NativeImageResourceBundleBuildItem> resources) {
@@ -92,14 +86,8 @@ public NonDefaultLocale(NativeConfig nativeConfig, LocalesBuildTimeConfig locale
9286

9387
@Override
9488
public boolean getAsBoolean() {
95-
return (nativeConfig.userLanguage().isPresent()
96-
&& !Locale.getDefault().getLanguage().equals(nativeConfig.userLanguage().get()))
97-
||
98-
(nativeConfig.userCountry().isPresent()
99-
&& !Locale.getDefault().getCountry().equals(nativeConfig.userCountry().get()))
100-
||
101-
(localesBuildTimeConfig.defaultLocale().isPresent() &&
102-
!Locale.getDefault().equals(localesBuildTimeConfig.defaultLocale().get()))
89+
return (localesBuildTimeConfig.defaultLocale().isPresent() &&
90+
!Locale.getDefault().equals(localesBuildTimeConfig.defaultLocale().get()))
10391
||
10492
localesBuildTimeConfig.locales().stream().anyMatch(l -> !Locale.getDefault().equals(l));
10593
}
@@ -110,8 +98,7 @@ public boolean getAsBoolean() {
11098
*
11199
* @param nativeConfig
112100
* @param localesBuildTimeConfig
113-
* @return User language set by 'quarkus.default-locale' or by deprecated 'quarkus.native.user-language' or
114-
* effectively LocalesBuildTimeConfig.DEFAULT_LANGUAGE if none of the aforementioned is set.
101+
* @return User language set by 'quarkus.default-locale' or effectively LocalesBuildTimeConfig.DEFAULT_LANGUAGE if not set.
115102
* @Deprecated
116103
*/
117104
@Deprecated
@@ -120,11 +107,6 @@ public static String nativeImageUserLanguage(NativeConfig nativeConfig, LocalesB
120107
if (localesBuildTimeConfig.defaultLocale().isPresent()) {
121108
language = localesBuildTimeConfig.defaultLocale().get().getLanguage();
122109
}
123-
if (nativeConfig.userLanguage().isPresent()) {
124-
log.warn(DEPRECATED_USER_LANGUAGE_WARNING);
125-
// The deprecated option takes precedence for users who are already using it.
126-
language = nativeConfig.userLanguage().get();
127-
}
128110
return language;
129111
}
130112

@@ -133,9 +115,7 @@ public static String nativeImageUserLanguage(NativeConfig nativeConfig, LocalesB
133115
*
134116
* @param nativeConfig
135117
* @param localesBuildTimeConfig
136-
* @return User country set by 'quarkus.default-locale' or by deprecated 'quarkus.native.user-country' or
137-
* effectively LocalesBuildTimeConfig.DEFAULT_COUNTRY (could be an empty string) if none of the aforementioned is
138-
* set.
118+
* @return User country set by 'quarkus.default-locale' or effectively LocalesBuildTimeConfig.DEFAULT_COUNTRY if not set.
139119
* @Deprecated
140120
*/
141121
@Deprecated
@@ -144,11 +124,6 @@ public static String nativeImageUserCountry(NativeConfig nativeConfig, LocalesBu
144124
if (localesBuildTimeConfig.defaultLocale().isPresent()) {
145125
country = localesBuildTimeConfig.defaultLocale().get().getCountry();
146126
}
147-
if (nativeConfig.userCountry().isPresent()) {
148-
log.warn(DEPRECATED_USER_COUNTRY_WARNING);
149-
// The deprecated option takes precedence for users who are already using it.
150-
country = nativeConfig.userCountry().get();
151-
}
152127
return country;
153128
}
154129

@@ -170,12 +145,7 @@ public static String nativeImageIncludeLocales(NativeConfig nativeConfig, Locale
170145

171146
// GraalVM for JDK 24 doesn't include the default locale used at build time. We must explicitly include the
172147
// specified locales - including the build-time locale if set by the user.
173-
// Note the deprecated options still count and take precedence.
174-
if (nativeConfig.userCountry().isPresent() && nativeConfig.userLanguage().isPresent()) {
175-
additionalLocales.add(new Locale(nativeConfig.userLanguage().get(), nativeConfig.userCountry().get()));
176-
} else if (nativeConfig.userLanguage().isPresent()) {
177-
additionalLocales.add(new Locale(nativeConfig.userLanguage().get()));
178-
} else if (localesBuildTimeConfig.defaultLocale().isPresent()) {
148+
if (localesBuildTimeConfig.defaultLocale().isPresent()) {
179149
additionalLocales.add(localesBuildTimeConfig.defaultLocale().get());
180150
}
181151

core/deployment/src/main/java/io/quarkus/deployment/steps/NativeImageFeatureStep.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,7 @@ public void write(String s, byte[] bytes) {
8989
overallCatch.marshalAsArray(String.class, overallCatch.load(""))); // empty string means initialize everything
9090

9191
// Set the user.language and user.country system properties to the default locale
92-
// The deprecated option takes precedence for users who are already using it.
93-
if (nativeConfig.userLanguage().isPresent()) {
94-
overallCatch.invokeStaticMethod(REGISTER_RUNTIME_SYSTEM_PROPERTIES,
95-
overallCatch.load("user.language"), overallCatch.load(nativeConfig.userLanguage().get()));
96-
if (nativeConfig.userCountry().isPresent()) {
97-
overallCatch.invokeStaticMethod(REGISTER_RUNTIME_SYSTEM_PROPERTIES,
98-
overallCatch.load("user.country"), overallCatch.load(nativeConfig.userCountry().get()));
99-
}
100-
} else if (localesBuildTimeConfig.defaultLocale().isPresent()) {
92+
if (localesBuildTimeConfig.defaultLocale().isPresent()) {
10193
overallCatch.invokeStaticMethod(REGISTER_RUNTIME_SYSTEM_PROPERTIES,
10294
overallCatch.load("user.language"),
10395
overallCatch.load(localesBuildTimeConfig.defaultLocale().get().getLanguage()));

0 commit comments

Comments
 (0)