Comments (6)
I agree. It could be documented with a reference to the dependencies here. I do that and submit a PR shortly.
from trellis.
@christopher-johnson would make sense to add a profile that selectively adds this dependency? I would want to make sure that h2 is still well supported on JDK 1.8
from trellis.
I think that supporting ALPN on JDK 1.8 is not so straightforward as JDK 9+, unless a specific version (e.g. 1.8.0u152).
"The ALPN implementation, relying on modifications of OpenJDK classes, updates every time there are updates to the modified OpenJDK classes." [1]
Binding a alpnBootVersion to a specific version of the JDK 8 is possible, I guess. The alpn-server only works on JDK 9, so JDK 8 seems to require alpn-boot (have not tested this yet).
Something like this could work:
if (Jvm.current().getJavaVersion().isJava9Compatible() || Jvm.current().getJavaVersion().isJava10Compatible()) {
compile group: 'org.eclipse.jetty', name: 'jetty-alpn-java-server', version: jettyAlpnServerVersion
} else {
compile group: 'org.mortbay.jetty.alpn', name: 'alpn-boot', version: jettyAlpnBootVersion
}
[1] https://www.eclipse.org/jetty/documentation/current/alpn-chapter.html#alpn-versions
from trellis.
In order to make ALPN work on JDK 8, one needs to add -Xbootclasspath/p:$path_to_alpn_boot.jar
as a JVM option. This is probably not feasible to do with gradle as it involves copying the alpn_boot library (from some flat_dir in the repo) to the build host, and then adding a applicationDefaultJvmArgs
to modify the application start script. It is pretty easy to set JAVA_OPTS
in docker, and then copy the lib into the image at that path, with something like this:
ENV ALPN_BOOT alpn-boot-8.1.12.v20180117.jar
ENV TRELLIS_RUNTIME /opt
ENV JAVA_OPTS="-Xms250m -Xmx1024m -Xbootclasspath/p:${TRELLIS_RUNTIME}/${ALPN_BOOT}"
I tested this and it works.
The question of how or if to conditionally support 9 ,10 and eventually 11 builds in the trellis gradle scripts is open. To build trellis-app with H2 for 9 only requires a couple of changes (adding the compile dependency on alpn-java-server and changing the target to 1.9). The alpn-java-server is a transitive dependency that is already included with dropwizard http2, and I guess the gradle declaration includes it to the runtime classpath(?).
To build for 10 requires excluding jacoco (you know about this), and to avoid javadoc warnings, adding this:
task docs(type: Javadoc) {
doFirst {
if (Jvm.current().getJavaVersion().isJava10Compatible()) {
addBooleanOption('html5', true)
}
}
...
One other note is that the trellis-app build.gradle
includes this:
artifacts {
archives javadocJar
archives sourceJar
}
I think that this can be removed since it is already in the rootProject build.gradle.
from trellis.
@christopher-johnson feel free to issue a PR that removes the redundant artifacts
section.
For the ALPN support in JDK 1.8, it seems like a docker-based solution would be best.
As for supporting jdk9+ builds, this will probably be an ongoing discussion. I'd like to have really solid support for JDK 1.8 but at the same time make it possible to build for newer environments. If that involves profiles or gradle conditional logic, let's continue to explore that.
from trellis.
This issue seems to be very much dependent on the deployment environment with little, if anything, to do with the Trellis codebase. I would like to either suggest that this issue be closed as-is (with no changes) or else be closed after some relevant documentation is added to one of the README files.
from trellis.
Related Issues (20)
- Resource type is determined by first link header, as opposed to first Link with rel="type"
- Encode IRIs when used with java.net.URI
- Disallow "unwise" characters from URLs
- Improve support for reserved characters
- Support JSON-LD 1.1 HOT 3
- Replace embedded pgsql test server
- Remove basic auth module
- Rename Event API to Notification
- Remove trellis-specific notification connectors
- Separate reactive API from synchronous API HOT 1
- Upgrade to MicroProfile 4.0
- Client support for NodeJS / other languages? HOT 2
- Positioning / contrast with Jena HOT 8
- 500 response returned from request with Accept: text/html header HOT 2
- Potential misuse of `JsonWebToken` in 2 classes HOT 1
- URI consistency for containers and the trailing slash HOT 1
- Make the `trellis:` constants overwritable
- Specify "MP_JWT_VERIFY_PUBLICKEY" as a requirement or remove the dependency
- Query parameters HOT 1
- Use of mutation testing in trellis - Help needed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trellis.