Skip to content

Commit

Permalink
Migrate to jakarta.servlet and Jetty 11 in modular-* archetypes
Browse files Browse the repository at this point in the history
dagger-guice-rf-activities would need more work as dagger
still uses javax.inject whereas jakarta.servlet requires
guice 7 which only supports jakarta.inject.
  • Loading branch information
tbroyer committed Jan 24, 2024
1 parent eecf349 commit 7a58252
Show file tree
Hide file tree
Showing 18 changed files with 48 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
</dependency>
<dependency>
<groupId>org.gwtproject.web.bindery</groupId>
<artifactId>requestfactory-server</artifactId>
<artifactId>requestfactory-server-jakarta</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ${package};

import com.google.web.bindery.requestfactory.server.RequestFactoryServlet;
import com.google.web.bindery.requestfactory.server.jakarta.RequestFactoryServlet;

public class GreetingResponse {
private boolean successful;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd"
version="5.0">

<!-- Servlets -->
<servlet>
<servlet-name>gwtRequest</servlet-name>
<servlet-class>com.google.web.bindery.requestfactory.server.RequestFactoryServlet</servlet-class>
<servlet-class>com.google.web.bindery.requestfactory.server.jakarta.RequestFactoryServlet</servlet-class>
</servlet>

<servlet-mapping>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
<scope>import</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>5.0.0</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down Expand Up @@ -68,7 +68,7 @@
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.4.53.v20231009</version>
<version>11.0.19</version>
</plugin>
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
</dependency>
<dependency>
<groupId>org.gwtproject.web.bindery</groupId>
<artifactId>requestfactory-server</artifactId>
<artifactId>requestfactory-server-jakarta</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package it.pkg;

import com.google.web.bindery.requestfactory.server.RequestFactoryServlet;
import com.google.web.bindery.requestfactory.server.jakarta.RequestFactoryServlet;

public class GreetingResponse {
private boolean successful;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd"
version="5.0">

<!-- Servlets -->
<servlet>
<servlet-name>gwtRequest</servlet-name>
<servlet-class>com.google.web.bindery.requestfactory.server.RequestFactoryServlet</servlet-class>
<servlet-class>com.google.web.bindery.requestfactory.server.jakarta.RequestFactoryServlet</servlet-class>
</servlet>

<servlet-mapping>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
<scope>import</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>5.0.0</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down Expand Up @@ -67,7 +67,7 @@
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.4.53.v20231009</version>
<version>11.0.19</version>
</plugin>
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
</dependency>
<dependency>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-servlet</artifactId>
<artifactId>gwt-servlet-jakarta</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ${package};

import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.google.gwt.user.server.rpc.jakarta.RemoteServiceServlet;

/**
* The server side implementation of the RPC service.

This comment has been minimized.

Copy link
@FrankHossfeld

FrankHossfeld Jan 24, 2024

We could add:

import jakarta.servlet.annotation.WebServlet;

@WebServlet("/${module-short-name}/greet")

and remove the servlet entry in the web.xml.

This comment has been minimized.

Copy link
@tbroyer

tbroyer Jan 24, 2024

Author Owner

I'm personally not a fan (this is an euphemism) of any such auto-discovery mechanisms so thanks but no thanks (and people will do whatever they want with the generated project anyway)

(fwiw, my belief is that WARs are an artifact of the past, but I also feel that using an embedded server here would likely be too opinionated)

This comment has been minimized.

Copy link
@FrankHossfeld

FrankHossfeld Jan 24, 2024

np, take it as a suggestion … I am fine with the web.xml.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd"
version="5.0">

<!-- Servlets -->
<servlet>

This comment has been minimized.

Copy link
@FrankHossfeld

FrankHossfeld Jan 24, 2024

See previous comment

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<dependencies>
<dependency>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-servlet</artifactId>
<artifactId>gwt-servlet-jakarta</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
8 changes: 4 additions & 4 deletions modular-webapp/src/main/resources/archetype-resources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
<scope>import</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>5.0.0</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down Expand Up @@ -68,7 +68,7 @@
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.4.53.v20231009</version>
<version>11.0.19</version>
</plugin>
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
</dependency>
<dependency>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-servlet</artifactId>
<artifactId>gwt-servlet-jakarta</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package it.pkg;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.google.gwt.user.server.rpc.jakarta.RemoteServiceServlet;

/**
* The server side implementation of the RPC service.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd"
version="5.0">

<!-- Servlets -->
<servlet>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<dependencies>
<dependency>
<groupId>org.gwtproject</groupId>
<artifactId>gwt-servlet</artifactId>
<artifactId>gwt-servlet-jakarta</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
<scope>import</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>5.0.0</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down Expand Up @@ -67,7 +67,7 @@
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.4.53.v20231009</version>
<version>11.0.19</version>
</plugin>
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
Expand Down

0 comments on commit 7a58252

Please sign in to comment.