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

WIP: Migrate to Jakarta EE 8 #4397

Closed
wants to merge 2 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.Properties;

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.ClassMatcher;
import org.eclipse.jetty.webapp.WebAppContext;
import org.eclipse.rdf4j.http.protocol.Protocol;
import org.eclipse.rdf4j.repository.RepositoryException;
Expand Down Expand Up @@ -66,7 +67,7 @@ public HTTPMemServer() throws IOException {
WebAppContext webapp = new WebAppContext();
webapp.setContextPath(RDF4J_CONTEXT);
webapp.setWar(webappDir);
webapp.getServerClasspathPattern().add("org.slf4j.", "ch.qos.logback.");
webapp.addServerClassMatcher(new ClassMatcher("org.slf4j.", "ch.qos.logback."));
jetty.setHandler(webapp);

manager = RemoteRepositoryManager.getInstance(SERVER_URL);
Expand Down
9 changes: 9 additions & 0 deletions compliance/solr/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<name>RDF4J: Solr Sail Tests</name>
<description>Tests for Solr Sail.</description>
<properties>
<!-- FIXME: Delete; Jetty 10.x requires Solr 9.x -->
<jetty.version>9.4.50.v20221201</jetty.version>
<!-- FIXME: Delete; Jetty 10.x requires Solr 9.x -->
<enforce-no-javax-dependencies.fail>false</enforce-no-javax-dependencies.fail>
<!-- used to set up embedded solr server in integration tests -->
<test.solr.home>${project.basedir}/solr</test.solr.home>
</properties>
Expand Down Expand Up @@ -62,6 +66,11 @@
<version>${solr.version}</version>
<scope>test</scope>
<exclusions>
<!-- FIXME: Uncomment; Jetty 10.x requires Solr 9.x -->
<!--exclusion>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</exclusion -->
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>*</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.util.Properties;

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.ClassMatcher;
import org.eclipse.jetty.webapp.WebAppContext;
import org.eclipse.rdf4j.http.protocol.Protocol;
import org.eclipse.rdf4j.repository.RepositoryException;
Expand Down Expand Up @@ -64,7 +65,7 @@ public SPARQLEmbeddedServer(List<String> repositoryIds) throws IOException {
jetty = new Server(PORT);

WebAppContext webapp = new WebAppContext();
webapp.getServerClasspathPattern().add("org.slf4j.", "ch.qos.logback.");
webapp.addServerClassMatcher(new ClassMatcher("org.slf4j.", "ch.qos.logback."));
webapp.setContextPath(SERVER_CONTEXT);
// warPath configured in pom.xml maven-war-plugin configuration
webapp.setWar(webappDir);
Expand Down
4 changes: 4 additions & 0 deletions core/sail/solr/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
<version>${solr.version}</version>
<optional>true</optional>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>*</artifactId>
Expand Down
36 changes: 34 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,11 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<enforce-javaee-provided.fail>true</enforce-javaee-provided.fail>
<enforce-no-javax-dependencies.fail>true</enforce-no-javax-dependencies.fail>
<jakartaee.version>8.0.0</jakartaee.version>
<!-- Jakarta XML Binding is part of Jakarta EE BOM from version 9 -->
<jaxb.version>2.3.3</jaxb.version>
<jetty.version>10.0.15</jetty.version>
<slf4j.version>1.7.36</slf4j.version>
<logback.version>1.2.11</logback.version>
<log4j.version>2.17.2</log4j.version>
Expand All @@ -377,12 +382,23 @@
<spring.version>5.3.23</spring.version>
<guava.version>30.1.1-jre</guava.version>
<jmhVersion>1.35</jmhVersion>
<servlet.version>3.1.0</servlet.version>
<junit.version>5.8.2</junit.version>
<jetty.version>9.4.50.v20221201</jetty.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-bom</artifactId>
<version>${jakartaee.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- Jakarta XML Binding is part of Jakarta EE BOM from version 9 -->
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>${jaxb.version}</version>
</dependency>
<!-- Jackson Bill-of-Materials -->
<dependency>
<groupId>com.fasterxml.jackson</groupId>
Expand Down Expand Up @@ -947,6 +963,22 @@
<fail>true</fail>
</configuration>
</execution>
<execution>
<id>enforce-banned-dependencies</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<bannedDependencies>
<excludes>
<exclude>javax.*</exclude>
</excludes>
</bannedDependencies>
</rules>
<fail>${enforce-no-javax-dependencies.fail}</fail>
</configuration>
</execution>
<execution>
<id>enforce-logging-dependencies</id>
<goals>
Expand Down
4 changes: 2 additions & 2 deletions site/content/documentation/tools/server-workbench.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ In this chapter, we explain how you can install RDF4J Server (the actual databas

RDF4J Server and RDF4J Workbench requires the following software:

- Java 8 Runtime Environment (either [OpenJDK](https://openjdk.java.net/) or [Oracle Java](https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html))
- A Java Servlet Container that supports Java Servlet API 3.1 and Java Server Pages (JSP) 2.2, or newer.
- Java 11 Runtime Environment (either [OpenJDK](https://openjdk.java.net/) or [Oracle Java](https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html))
- A Java Servlet Container that supports Java Servlet API 4.0 and Java Server Pages (JSP) 2.3, or newer.

We recommend using a recent, stable version of [Apache Tomcat](https://tomcat.apache.org/) ([version 9.0](https://tomcat.apache.org/download-90.cgi) at the time of writing).

Expand Down
2 changes: 1 addition & 1 deletion tools/federation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<!-- TODO ideally reuse repository-compliace -->
<!-- TODO ideally reuse repository-compliance -->
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.webapp.ClassMatcher;
import org.eclipse.jetty.webapp.WebAppContext;

public class EmbeddedServer {
Expand All @@ -39,7 +40,7 @@ public EmbeddedServer(String host, int port, String contextPath, String warPath)
jetty.addConnector(conn);

WebAppContext webapp = new WebAppContext();
webapp.getServerClasspathPattern().add("org.slf4j.", "ch.qos.logback.");
webapp.addServerClassMatcher(new ClassMatcher("org.slf4j.", "ch.qos.logback."));
webapp.setContextPath(contextPath);
webapp.setTempDirectory(new File("temp/webapp/"));
webapp.setWar(warPath);
Expand Down
16 changes: 0 additions & 16 deletions tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,6 @@
</profiles>
<dependencyManagement>
<dependencies>
<!-- Java Enterprise Edition -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${servlet.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.ebaysf.web</groupId>
<artifactId>cors-filter</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions tools/server-spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
8 changes: 4 additions & 4 deletions tools/server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<groupId>jakarta.servlet.jsp</groupId>
<artifactId>jakarta.servlet.jsp-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<groupId>jakarta.servlet.jsp.jstl</groupId>
<artifactId>jakarta.servlet.jsp.jstl-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.webapp.ClassMatcher;
import org.eclipse.jetty.webapp.WebAppContext;
import org.eclipse.rdf4j.http.protocol.Protocol;
import org.eclipse.rdf4j.repository.RepositoryException;
Expand Down Expand Up @@ -69,7 +70,7 @@ public TestServer() throws IOException {
jetty.addConnector(conn);

WebAppContext webapp = new WebAppContext();
webapp.getServerClasspathPattern().add("org.slf4j.", "ch.qos.logback.");
webapp.addServerClassMatcher(new ClassMatcher("org.slf4j.", "ch.qos.logback."));
webapp.setContextPath(RDF4J_CONTEXT);
// warPath configured in pom.xml maven-war-plugin configuration
webapp.setWar("./target/rdf4j-server");
Expand Down
4 changes: 2 additions & 2 deletions tools/workbench/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down