-
Notifications
You must be signed in to change notification settings - Fork 50
Upgrade to Jetty 12 #103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to Jetty 12 #103
Conversation
This commit upgrades the codebase to use jetty 12 along with all the dependent modules. There are a large number of changes outside of jetty that are required to comply with the updated APIs as well as some of the newer modernizer rules that execute with the target bytecode of some modules set to 17 The main types of changes are outlined below: 1. Nearly all usage of packages from javax.annotation, javax.validation javax.inject, javax.ws.rs-api, and javax.servlet have been replaced with the newer jakarta.* APIs. This is a requirement due to the newer jetty version requiring these libraries in order properly function. Some annotations have been removed entirely from the jakarta.annotation package, so they have been replaced with equivalent annotations from com.google.errorprone:error_prone_annotations package. Guice was upgraded to 7.0 to support the jakarta.inject namespace 2. Minimum bytecode level on some modules being raised to 17. Due to Jetty 12 being compiled for Java 17 bytecode, it means modules which rely on jetty directly and transitively must be compiled with java 17 bytecode as well. http-client and http-server are the modules with direct dependencies on jetty, but many other such as event, discovery, and more have their bytecode level increased in order to accomodate the jetty upgrade. Bytecode levels are set in the project's pom.xml <properties> tag using <project.build.targetJdk> 3. Modernizer changes. Due to modules being upgraded to Java 17 bytecode some new modernizer rules are now enforced to take advantage of the new Java 17 APIs. Many modules have slight changes to comply with our modernizer plugin. Most changes center around using Path instead of File and Java Streams API equivalents in place of Guava Iterables and Functions 4. The configuration's validator implementation is updated to use the hibernate validator instead of Apache bval-jsr. This is because the bval-jsr dependency does not support the jakarta namespace annotations at a java 8 bytecode level. Hibernate is used because it satisfies the requirement to keep this module at Java 8 bytecode. Aside from these, the rest of the changes center around supporting Jetty 12's new APIs within our http-client and http-server implementation. For example, supporting the new ContentProvider APIs and changing usages of deprecated or removed methods from Jetty 9.
Please retain attribution in your commit to the original author or at least add @wendigo with the |
@mosabua I've written all this code myself. Can you point to which changes you think need to be attributed? |
@ZacBlanco configuration changes are exactly the same as in the airlift/airlift for example |
That is not the case. One example at: airlift/configuration/src/main/java/com/facebook/airlift/configuration/ConfigurationLoader.java Line 59 in 396141b
is different than in airlift/airlift at the same location. I understand many changes will be similar due to mechanical renames from the javax to jakarta namespace, but there are plenty of places where I made changes that are very likely to be different from the upstream airlift repository. At no time while I authored this PR did I copy or cherry-pick any changes from airlift/airlift |
airlift/configuration/src/main/java/com/facebook/airlift/configuration/testing/ConfigAssertions.java Line 276 in 396141b
vs https://github.com/airlift/airlift/blob/28168d00c0ff551675974f70b3b363317660f69e/configuration-testing/src/main/java/io/airlift/configuration/testing/ConfigAssertions.java#L280 Even the exception message and extracted methods are the same (same structure, same naming, same variables) is so it's reasonable for me to have doubts. |
Clone PR of #99
This PR moves airlift from Jetty 9.X to Jetty 12, the latest stable Jetty release. It provides a wide range of improvements
It also however requires significant refactoring of not just the Jetty libraries, but also moving things like javax servlets to the jakarta namespace as well as bumping the minimum bytecode version on components which rely on jetty to Java 17.