JPMS for Jetty modules

Signed-off-by: Maxim Nesen <maxim.nesen@oracle.com>
diff --git a/connectors/jetty-http2-connector/src/main/java/module-info.java b/connectors/jetty-http2-connector/src/main/java/module-info.java
new file mode 100644
index 0000000..867251b
--- /dev/null
+++ b/connectors/jetty-http2-connector/src/main/java/module-info.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+module org.glassfish.jersey.jetty.http2.connector {
+
+    requires jakarta.ws.rs;
+
+    requires org.eclipse.jetty.client;
+    requires org.eclipse.jetty.http2.client;
+    requires org.eclipse.jetty.http2.client.transport;
+
+    requires org.glassfish.jersey.core.common;
+    requires org.glassfish.jersey.core.client;
+    requires org.glassfish.jersey.jetty.connector;
+
+    exports org.glassfish.jersey.jetty.http2.connector;
+    opens org.glassfish.jersey.jetty.http2.connector;
+}
\ No newline at end of file
diff --git a/connectors/jetty-http2-connector/src/test/java/module-info.java b/connectors/jetty-http2-connector/src/test/java/module-info.java
new file mode 100644
index 0000000..5453358
--- /dev/null
+++ b/connectors/jetty-http2-connector/src/test/java/module-info.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+module org.glassfish.jersey.jetty.http2.connector {
+
+    requires jakarta.inject;
+    requires jakarta.ws.rs;
+    requires jakarta.xml.bind;
+
+    requires java.logging;
+
+    requires org.eclipse.jetty.client;
+    requires org.eclipse.jetty.http2.client;
+    requires org.eclipse.jetty.http2.client.transport;
+
+    requires org.glassfish.jersey.core.common;
+    requires org.glassfish.jersey.core.client;
+    requires org.glassfish.jersey.core.server;
+    requires org.glassfish.jersey.jetty.connector;
+
+    requires org.junit.jupiter.api;
+    requires org.hamcrest;
+
+    requires org.glassfish.jersey.tests.framework.core;
+
+    exports org.glassfish.jersey.jetty.http2.connector;
+    opens org.glassfish.jersey.jetty.http2.connector;
+}
\ No newline at end of file
diff --git a/connectors/jetty11-connector/pom.xml b/connectors/jetty11-connector/pom.xml
index c25195f..ec70396 100644
--- a/connectors/jetty11-connector/pom.xml
+++ b/connectors/jetty11-connector/pom.xml
@@ -120,6 +120,46 @@
             <artifactId>jaxb-osgi</artifactId>
             <scope>test</scope>
         </dependency>
+        <!--required by Grizzly* modules-->
+        <dependency>
+            <groupId>org.glassfish.pfl</groupId>
+            <artifactId>pfl-tf</artifactId>
+            <version>${pfl.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.glassfish.gmbal</groupId>
+            <artifactId>gmbal</artifactId>
+            <version>${gmbal.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.ow2.asm</groupId>
+                    <artifactId>asm-tree</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.ow2.asm</groupId>
+                    <artifactId>asm</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.ow2.asm</groupId>
+                    <artifactId>asm-commons</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.ow2.asm</groupId>
+                    <artifactId>asm-util</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.ow2.asm</groupId>
+                    <artifactId>asm-analysis</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.ow2.asm</groupId>
+            <artifactId>asm-commons</artifactId>
+            <version>${asm.version}</version>
+        </dependency>
+        <!--End of required by Grizzly* modules-->
     </dependencies>
 
     <build>
diff --git a/connectors/jetty11-connector/src/main/java/module-info.java b/connectors/jetty11-connector/src/main/java/module-info.java
new file mode 100644
index 0000000..62dbbb8
--- /dev/null
+++ b/connectors/jetty11-connector/src/main/java/module-info.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+module org.glassfish.jersey.jetty11.connector {
+    requires java.logging;
+
+    requires jakarta.ws.rs;
+
+    requires org.eclipse.jetty.client;
+    requires org.eclipse.jetty.http;
+    requires org.eclipse.jetty.io;
+    requires org.eclipse.jetty.util;
+
+    requires org.glassfish.jersey.core.common;
+    requires org.glassfish.jersey.core.client;
+
+    exports org.glassfish.jersey.jetty.connector;
+    opens org.glassfish.jersey.jetty.connector;
+}
\ No newline at end of file
diff --git a/connectors/jetty11-connector/src/test/java/module-info.java b/connectors/jetty11-connector/src/test/java/module-info.java
new file mode 100644
index 0000000..319b51d
--- /dev/null
+++ b/connectors/jetty11-connector/src/test/java/module-info.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+module org.glassfish.jersey.jetty11.connector {
+    requires java.logging;
+
+    requires jakarta.inject;
+    requires jakarta.ws.rs;
+
+    requires org.eclipse.jetty.client;
+//    requires org.eclipse.jetty.server;
+    requires org.eclipse.jetty.http;
+    requires org.eclipse.jetty.io;
+    requires org.eclipse.jetty.util;
+
+    requires org.junit.jupiter.api;
+    requires org.junit.jupiter.engine;
+    requires org.hamcrest;
+
+    //  required by Grizzly* modules
+    requires pfl.tf;
+    requires gmbal;
+//    end of required by Grizzly* modules
+
+    requires jakarta.xml.bind;
+
+    requires org.glassfish.jersey.tests.framework.core;
+
+    requires org.glassfish.jersey.core.common;
+    requires org.glassfish.jersey.core.client;
+    requires org.glassfish.jersey.core.server;
+
+    exports org.glassfish.jersey.jetty.connector;
+    opens org.glassfish.jersey.jetty.connector;
+}
\ No newline at end of file
diff --git a/containers/jetty-http2/src/main/java/module-info.java b/containers/jetty-http2/src/main/java/module-info.java
new file mode 100644
index 0000000..b8f6be4
--- /dev/null
+++ b/containers/jetty-http2/src/main/java/module-info.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2022, 2023 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+module org.glassfish.jersey.container.jetty.http2 {
+
+    requires jakarta.ws.rs;
+
+    requires org.eclipse.jetty.http2.server;
+    requires org.eclipse.jetty.alpn.server;
+
+    requires org.glassfish.jersey.core.common;
+    requires org.glassfish.jersey.core.server;
+    requires org.glassfish.jersey.container.jetty.http;
+
+    exports org.glassfish.jersey.jetty.http2;
+    opens org.glassfish.jersey.jetty.http2;
+}
\ No newline at end of file
diff --git a/containers/jetty-http2/src/main/java/org/glassfish/jersey/jetty/http2/JettyHttp2ContainerProvider.java b/containers/jetty-http2/src/main/java/org/glassfish/jersey/jetty/http2/JettyHttp2ContainerProvider.java
index 01c61fc..f516357 100644
--- a/containers/jetty-http2/src/main/java/org/glassfish/jersey/jetty/http2/JettyHttp2ContainerProvider.java
+++ b/containers/jetty-http2/src/main/java/org/glassfish/jersey/jetty/http2/JettyHttp2ContainerProvider.java
@@ -19,7 +19,6 @@
 import org.glassfish.jersey.internal.util.JdkVersion;
 import org.glassfish.jersey.jetty.JettyHttpContainer;
 import org.glassfish.jersey.jetty.JettyHttpContainerProvider;
-import org.glassfish.jersey.jetty.internal.LocalizationMessages;
 import org.glassfish.jersey.server.spi.ContainerProvider;
 
 import jakarta.ws.rs.ProcessingException;
diff --git a/containers/jetty-http2/src/test/java/module-info.java b/containers/jetty-http2/src/test/java/module-info.java
new file mode 100644
index 0000000..d8f20dd
--- /dev/null
+++ b/containers/jetty-http2/src/test/java/module-info.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2022, 2023 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+module org.glassfish.jersey.container.jetty.http2 {
+    requires java.logging;
+
+    requires jakarta.ws.rs;
+
+    requires org.eclipse.jetty.http2.server;
+    requires org.eclipse.jetty.alpn.server;
+
+    requires org.glassfish.jersey.core.common;
+    requires org.glassfish.jersey.core.server;
+    requires org.glassfish.jersey.container.jetty.http;
+
+    requires org.junit.jupiter.api;
+    requires org.hamcrest;
+
+    exports org.glassfish.jersey.jetty.http2;
+    opens org.glassfish.jersey.jetty.http2;
+}
\ No newline at end of file
diff --git a/core-client/src/main/java/module-info.java b/core-client/src/main/java/module-info.java
index 52d96f1..983c854 100644
--- a/core-client/src/main/java/module-info.java
+++ b/core-client/src/main/java/module-info.java
@@ -35,6 +35,7 @@
             org.glassfish.jersey.apache.connector,
             org.glassfish.jersey.netty.connector,
             org.glassfish.jersey.grizzly.connector,
+            org.glassfish.jersey.jetty11.connector,
             org.glassfish.jersey.jetty.connector;
 
     exports org.glassfish.jersey.client.innate.http to
diff --git a/test-framework/providers/jetty-http2/src/main/java/module-info.java b/test-framework/providers/jetty-http2/src/main/java/module-info.java
new file mode 100644
index 0000000..80b26bd
--- /dev/null
+++ b/test-framework/providers/jetty-http2/src/main/java/module-info.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+module org.glassfish.jersey.tests.framework.provider.jetty.http2 {
+    requires java.logging;
+
+    requires jakarta.servlet;
+    requires jakarta.ws.rs;
+
+    requires org.eclipse.jetty.server;
+
+    requires org.glassfish.jersey.tests.framework.core;
+    requires org.glassfish.jersey.core.common;
+    requires org.glassfish.jersey.core.client;
+    requires org.glassfish.jersey.container.jetty.http2;
+
+    exports org.glassfish.jersey.test.jetty.http2;
+}
\ No newline at end of file
diff --git a/test-framework/providers/jetty-http2/src/test/java/module-info.java b/test-framework/providers/jetty-http2/src/test/java/module-info.java
new file mode 100644
index 0000000..b539bf2
--- /dev/null
+++ b/test-framework/providers/jetty-http2/src/test/java/module-info.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+module org.glassfish.jersey.tests.framework.provider.jetty.http2 {
+    requires java.logging;
+
+    requires jakarta.ws.rs;
+
+    requires org.eclipse.jetty.server;
+
+    requires org.glassfish.jersey.tests.framework.core;
+    requires org.glassfish.jersey.core.common;
+    requires org.glassfish.jersey.core.client;
+    requires org.glassfish.jersey.core.server;
+    requires org.glassfish.jersey.container.jetty.http;
+    requires org.glassfish.jersey.container.jetty.http2;
+    requires org.glassfish.jersey.inject.hk2;
+
+    exports org.glassfish.jersey.test.jetty.http2;
+
+    opens org.glassfish.jersey.test.jetty.http2;
+
+    requires org.junit.jupiter.api;
+    requires org.hamcrest;
+}
\ No newline at end of file
diff --git a/test-framework/providers/jetty/src/main/java/module-info.java b/test-framework/providers/jetty/src/main/java/module-info.java
new file mode 100644
index 0000000..8f4fa25
--- /dev/null
+++ b/test-framework/providers/jetty/src/main/java/module-info.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+module org.glassfish.jersey.tests.framework.provider.jetty {
+    requires java.logging;
+
+//    requires jakarta.servlet;
+    requires jakarta.ws.rs;
+
+    requires org.eclipse.jetty.server;
+
+    requires org.glassfish.jersey.tests.framework.core;
+    requires org.glassfish.jersey.core.common;
+    requires org.glassfish.jersey.core.client;
+    requires org.glassfish.jersey.container.jetty.http;
+
+    exports org.glassfish.jersey.test.jetty;
+}
\ No newline at end of file
diff --git a/test-framework/providers/jetty/src/main/java11/org/glassfish/jersey/test/jetty/JettyTestContainerFactory.java b/test-framework/providers/jetty/src/main/java11/org/glassfish/jersey/test/jetty/JettyTestContainerFactory.java
index 1632869..315c49d 100644
--- a/test-framework/providers/jetty/src/main/java11/org/glassfish/jersey/test/jetty/JettyTestContainerFactory.java
+++ b/test-framework/providers/jetty/src/main/java11/org/glassfish/jersey/test/jetty/JettyTestContainerFactory.java
@@ -17,7 +17,7 @@
 package org.glassfish.jersey.test.jetty;
 
 import jakarta.ws.rs.ProcessingException;
-import org.glassfish.jersey.jetty.internal.LocalizationMessages;
+import org.glassfish.jersey.test.jetty.internal.LocalizationMessages;
 import org.glassfish.jersey.test.DeploymentContext;
 import org.glassfish.jersey.test.spi.TestContainer;
 import org.glassfish.jersey.test.spi.TestContainerFactory;
diff --git a/test-framework/providers/jetty/src/main/resources/org/glassfish/jersey/jetty/internal/localization.properties b/test-framework/providers/jetty/src/main/resources/org/glassfish/jersey/jetty/test/internal/localization.properties
similarity index 100%
rename from test-framework/providers/jetty/src/main/resources/org/glassfish/jersey/jetty/internal/localization.properties
rename to test-framework/providers/jetty/src/main/resources/org/glassfish/jersey/jetty/test/internal/localization.properties
diff --git a/test-framework/providers/jetty/src/test/java/module-info.java b/test-framework/providers/jetty/src/test/java/module-info.java
new file mode 100644
index 0000000..a01ea27
--- /dev/null
+++ b/test-framework/providers/jetty/src/test/java/module-info.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v. 2.0, which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * This Source Code may also be made available under the following Secondary
+ * Licenses when the conditions for such availability set forth in the
+ * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
+ * version 2 with the GNU Classpath Exception, which is available at
+ * https://www.gnu.org/software/classpath/license.html.
+ *
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
+ */
+
+module org.glassfish.jersey.tests.framework.provider.jetty {
+    requires java.logging;
+
+    requires jakarta.inject;
+    requires static jakarta.servlet;
+    requires jakarta.ws.rs;
+
+    requires org.eclipse.jetty.server;
+
+    requires org.glassfish.jersey.tests.framework.core;
+    requires org.glassfish.jersey.core.common;
+    requires org.glassfish.jersey.core.client;
+    requires org.glassfish.jersey.core.server;
+    requires org.glassfish.jersey.container.jetty.http;
+    requires org.glassfish.jersey.inject.hk2;
+
+    exports org.glassfish.jersey.test.jetty;
+
+    opens org.glassfish.jersey.test.jetty;
+
+    requires org.junit.jupiter.api;
+    requires org.junit.jupiter.engine;
+    requires org.hamcrest;
+}
\ No newline at end of file