Merge pull request #5494 from eclipse/jetty-9.4.x-5492-java-features-start-properties
Issue #5492 - Adding java.features.* start properties
This commit is contained in:
commit
bbcae23774
|
@ -1,7 +0,0 @@
|
|||
# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html
|
||||
|
||||
[description]
|
||||
Selects an ALPN (Application Layer Protocol Negotiation) implementation by java version.
|
||||
|
||||
[depend]
|
||||
alpn-impl/alpn-${java.version.platform}
|
|
@ -1,4 +0,0 @@
|
|||
# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html
|
||||
|
||||
[depend]
|
||||
alpn-impl/alpn-9
|
|
@ -1,4 +0,0 @@
|
|||
# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html
|
||||
|
||||
[depend]
|
||||
alpn-impl/alpn-9
|
|
@ -1,4 +0,0 @@
|
|||
# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html
|
||||
|
||||
[depend]
|
||||
alpn-impl/alpn-11
|
|
@ -1,4 +0,0 @@
|
|||
# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html
|
||||
|
||||
[depend]
|
||||
alpn-impl/alpn-11
|
|
@ -1,4 +0,0 @@
|
|||
# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html
|
||||
|
||||
[depend]
|
||||
alpn-impl/alpn-11
|
|
@ -1,4 +0,0 @@
|
|||
# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html
|
||||
|
||||
[depend]
|
||||
alpn-impl/alpn-11
|
|
@ -5,7 +5,7 @@ Enables the ALPN (Application Layer Protocol Negotiation) TLS extension.
|
|||
|
||||
[depend]
|
||||
ssl
|
||||
alpn-impl
|
||||
alpn-impl/alpn-available-${runtime.feature.alpn}
|
||||
|
||||
[lib]
|
||||
lib/jetty-alpn-client-${jetty.version}.jar
|
||||
|
|
|
@ -1505,10 +1505,14 @@ public class StartArgs
|
|||
{
|
||||
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)
|
||||
{
|
||||
|
@ -1525,6 +1529,19 @@ public class StartArgs
|
|||
}
|
||||
}
|
||||
|
||||
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;
|
||||
|
|
|
@ -143,6 +143,7 @@ public class ConfigurationAssert
|
|||
"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.
|
||||
|
|
|
@ -225,8 +225,11 @@ public class MainTest
|
|||
{
|
||||
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<String> cmdLineArgs = new ArrayList<>();
|
||||
cmdLineArgs.add("user.dir=" + homePath);
|
||||
|
|
Loading…
Reference in New Issue