Skip to content
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 service framework to support jakarta (JEE 9) #109

Merged
merged 8 commits into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions owasp-suppressions.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<suppressions xmlns="https://jeremylong.github.io/DependencyCheck/dependency-suppression.1.3.xsd">
<suppress>
<notes><![CDATA[
file name: jetty-http-11.0.20.jar
]]></notes>
<packageUrl regex="true">^pkg:maven/org\.eclipse\.jetty/jetty\-.*@.*$</packageUrl>
<cve>CVE-2024-8184</cve>
<cve>CVE-2024-6763</cve>
</suppress>
</suppressions>
13 changes: 6 additions & 7 deletions platform-http-service-framework/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,17 @@ dependencies {
api(project(":platform-service-framework"))
api("org.hypertrace.core.grpcutils:grpc-client-utils:0.13.7")
api("com.typesafe:config:1.4.2")
api("javax.servlet:javax.servlet-api:4.0.1")
api("com.google.inject:guice:5.1.0")
api("jakarta.servlet:jakarta.servlet-api:6.0.0")
api("com.google.inject:guice:7.0.0")
api(project(":service-framework-spi"))

implementation(project(":platform-metrics"))
implementation("org.slf4j:slf4j-api:1.7.36")
implementation("com.google.inject.extensions:guice-servlet:5.1.0")
implementation("com.google.inject.extensions:guice-servlet:7.0.0")
implementation("com.google.guava:guava:31.1-jre")
implementation("org.eclipse.jetty:jetty-servlet:9.4.56.v20240826")
implementation("org.eclipse.jetty:jetty-server:9.4.56.v20240826")
implementation("org.eclipse.jetty:jetty-servlets:9.4.56.v20240826")

implementation("org.eclipse.jetty:jetty-servlet:11.0.20")
implementation("org.eclipse.jetty:jetty-server:11.0.20")
implementation("org.eclipse.jetty:jetty-servlets:11.0.20")
annotationProcessor("org.projectlombok:lombok:1.18.24")
compileOnly("org.projectlombok:lombok:1.18.24")
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.hypertrace.core.serviceframework.http;

import com.google.inject.Injector;
import jakarta.servlet.MultipartConfigElement;
import jakarta.servlet.Servlet;
import java.util.List;
import java.util.Map;
import javax.servlet.MultipartConfigElement;
import javax.servlet.Servlet;
import lombok.Builder;
import lombok.Singular;
import lombok.Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

import com.google.inject.Injector;
import com.google.inject.servlet.GuiceFilter;
import jakarta.servlet.DispatcherType;
import jakarta.servlet.ServletContextListener;
import java.nio.file.Path;
import java.util.EnumSet;
import java.util.LinkedList;
Expand All @@ -15,8 +17,6 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import javax.annotation.Nullable;
import javax.servlet.DispatcherType;
import javax.servlet.ServletContextListener;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.HttpConfiguration;
Expand Down
12 changes: 6 additions & 6 deletions platform-metrics/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ tasks.test {

dependencies {
api("com.typesafe:config:1.4.2")
api("io.dropwizard.metrics:metrics-core:4.2.16")
api("io.dropwizard.metrics:metrics-jakarta-servlet:4.2.25")
api("io.micrometer:micrometer-core:1.10.2")
api("javax.servlet:javax.servlet-api:3.1.0")
api("jakarta.servlet:jakarta.servlet-api:6.0.0")

implementation("io.micrometer:micrometer-registry-prometheus:1.10.2")

implementation("io.github.mweirauch:micrometer-jvm-extras:0.2.2")
implementation("org.slf4j:slf4j-api:1.7.36")
implementation("io.dropwizard.metrics:metrics-jvm:4.2.16")
implementation("io.prometheus:simpleclient_dropwizard:0.12.0")
implementation("io.prometheus:simpleclient_servlet:0.12.0")
implementation("io.prometheus:simpleclient_pushgateway:0.12.0")
implementation("org.eclipse.jetty:jetty-servlet:9.4.56.v20240826")
implementation("io.prometheus:simpleclient_dropwizard:0.16.0")
implementation("io.prometheus:simpleclient_servlet_jakarta:0.16.0")
implementation("io.prometheus:simpleclient_pushgateway:0.16.0")
implementation("org.eclipse.jetty:jetty-servlet:11.0.20")
implementation("com.google.guava:guava:32.0.1-jre")

compileOnly("com.github.ben-manes.caffeine:caffeine:3.1.8")
Expand Down
8 changes: 3 additions & 5 deletions platform-service-framework/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ dependencies {
api("com.typesafe:config:1.4.2")

// Use for thread dump servlet
implementation("io.dropwizard.metrics:metrics-servlets:4.2.16")
implementation("org.eclipse.jetty:jetty-servlet:9.4.56.v20240826")
implementation("io.dropwizard.metrics:metrics-jakarta-servlets:4.2.25")
implementation("org.eclipse.jetty:jetty-servlet:11.0.20")

// Use for metrics servlet
implementation("io.prometheus:simpleclient_servlet:0.12.0")
implementation("io.prometheus:simpleclient_servlet_jakarta:0.16.0")

// http client
implementation("org.apache.httpcomponents:httpclient:4.5.13")
Expand All @@ -36,6 +36,4 @@ dependencies {
testImplementation("org.apache.logging.log4j:log4j-slf4j-impl:2.19.0")
testImplementation("org.junit.jupiter:junit-jupiter:5.9.0")
testImplementation("org.mockito:mockito-core:4.8.0")
testImplementation("org.eclipse.jetty:jetty-servlet:9.4.56.v20240826:tests")
testImplementation("org.eclipse.jetty:jetty-http:9.4.56.v20240826:tests")
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.hypertrace.core.serviceframework;

import com.codahale.metrics.servlets.CpuProfileServlet;
import com.codahale.metrics.servlets.ThreadDumpServlet;
import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;
import io.prometheus.client.exporter.MetricsServlet;
import io.dropwizard.metrics.servlets.CpuProfileServlet;
import io.dropwizard.metrics.servlets.ThreadDumpServlet;
import io.prometheus.client.servlet.jakarta.exporter.MetricsServlet;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.UnknownHostException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.hypertrace.core.serviceframework.service.servlets;

import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.hypertrace.core.serviceframework.PlatformService;

public class HealthCheckServlet extends HttpServlet {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package org.hypertrace.core.serviceframework.service.servlets;

import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.lang.management.ManagementFactory;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.hypertrace.core.serviceframework.jvm.JVMDiagnosticCommand;
import org.hypertrace.core.serviceframework.jvm.JVMDiagnosticCommand.Op;

Expand Down
Loading