Add property 'server.tomcat.use-apr' to control Tomcat's APR

The property's default depends on the Java version. On Java < 24, it defaults
to WHEN_AVAILABLE, on Java >=24 it defaults to NEVER.

Closes gh-44033
This commit is contained in:
Moritz Halbritter
2025-03-07 13:41:32 +01:00
parent 59ddba1063
commit 7fcf34eaeb
10 changed files with 180 additions and 47 deletions

View File

@@ -90,15 +90,12 @@ class LoaderIntegrationTests {
.withLogConsumer(this.output)
.withCopyFileToContainer(findApplication(name, classifier), "/app.jar")
.withStartupCheckStrategy(new OneShotStartupCheckStrategy().withTimeout(Duration.ofMinutes(5)))
.withCommand(command(javaRuntime));
.withCommand(command());
}
private String[] command(JavaRuntime javaRuntime) {
private String[] command() {
List<String> command = new ArrayList<>();
command.add("java");
if (javaRuntime.version == JavaVersion.TWENTY_FOUR) {
command.add("--enable-native-access=ALL-UNNAMED");
}
command.add("-jar");
command.add("app.jar");
return command.toArray(new String[0]);