diff --git a/jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/jetty-simple-webapp/src/base/modules/testmod.mod b/jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/jetty-simple-webapp/src/base/modules/testmod.mod deleted file mode 100644 index 83d7fc98732e..000000000000 --- a/jetty-maven-plugin/src/it/jetty-start-war-distro-mojo-it/jetty-simple-webapp/src/base/modules/testmod.mod +++ /dev/null @@ -1,12 +0,0 @@ -# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[description] -Enables test setup - -[depend] -http - - -[xml] -etc/test-jetty.xml - diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java b/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java index a9a3af2344f8..8516c0573d45 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java @@ -1528,10 +1528,14 @@ public void setProperty(String key, String value, String source) { JavaVersion ver = JavaVersion.parse(value); properties.setProperty("java.version.platform", Integer.toString(ver.getPlatform()), source); + // @deprecated - below will be removed in Jetty 10.x properties.setProperty("java.version.major", Integer.toString(ver.getMajor()), "Deprecated"); properties.setProperty("java.version.minor", Integer.toString(ver.getMinor()), "Deprecated"); properties.setProperty("java.version.micro", Integer.toString(ver.getMicro()), "Deprecated"); + + // ALPN feature exists + properties.setProperty("runtime.feature.alpn", Boolean.toString(isMethodAvailable(javax.net.ssl.SSLParameters.class, "getApplicationProtocols", null)), source); } catch (Throwable x) { @@ -1548,6 +1552,19 @@ public void setProperty(String key, String value, String source) } } + private boolean isMethodAvailable(Class clazz, String methodName, Class[] params) + { + try + { + clazz.getMethod(methodName, params); + return true; + } + catch (NoSuchMethodException e) + { + return false; + } + } + public void setRun(boolean run) { this.run = run; diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/ConfigurationAssert.java b/jetty-start/src/test/java/org/eclipse/jetty/start/ConfigurationAssert.java index a7832271c7dd..f885e9b81edc 100644 --- a/jetty-start/src/test/java/org/eclipse/jetty/start/ConfigurationAssert.java +++ b/jetty-start/src/test/java/org/eclipse/jetty/start/ConfigurationAssert.java @@ -138,6 +138,7 @@ public static void assertConfiguration(BaseHome baseHome, StartArgs args, String "jetty.base.uri".equals(name) || "user.dir".equals(name) || prop.source.equals(Props.ORIGIN_SYSPROP) || + name.startsWith("runtime.feature.") || name.startsWith("java.")) { // strip these out from assertion, to make assertions easier. diff --git a/jetty-start/src/test/java/org/eclipse/jetty/start/MainTest.java b/jetty-start/src/test/java/org/eclipse/jetty/start/MainTest.java index 1a5b7a2cda6c..eb436b41896d 100644 --- a/jetty-start/src/test/java/org/eclipse/jetty/start/MainTest.java +++ b/jetty-start/src/test/java/org/eclipse/jetty/start/MainTest.java @@ -220,8 +220,11 @@ public void testJettyHomeWithSpaces() throws Exception { Path distPath = MavenTestingUtils.getTestResourceDir("dist-home").toPath().toRealPath(); Path homePath = MavenTestingUtils.getTargetTestingPath().resolve("dist home with spaces"); - IO.copy(distPath.toFile(), homePath.toFile()); - Files.createFile(homePath.resolve("lib/a library.jar")); + if (!Files.exists(homePath)) + { + IO.copy(distPath.toFile(), homePath.toFile()); + Files.createFile(homePath.resolve("lib/a library.jar")); + } List cmdLineArgs = new ArrayList<>(); cmdLineArgs.add("user.dir=" + homePath);