From 65a016d1aa9a78b04be2d1ab707319125ece7d57 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Fri, 24 May 2024 15:46:09 +0200 Subject: [PATCH] Fixes #11778 - jetty-http-spi does not properly provide SPI for modules. Fixed all module-info.java files that did not have a "provides" declaration but had META-INF/services files. Signed-off-by: Simone Bordet --- .../jetty-http-spi/src/main/java/module-info.java | 7 ++++++- .../src/main/java/module-info.java | 3 ++- .../org.eclipse.jetty.websocket.core.Extension | 4 ++-- .../jetty-ee10-cdi/src/main/java/module-info.java | 10 +++++++++- .../org.eclipse.jetty.ee10.webapp.Configuration | 2 +- .../src/main/java/module-info.java | 6 ++++++ .../jakarta.servlet.ServletContainerInitializer | 2 +- .../org.eclipse.jetty.ee10.webapp.Configuration | 2 +- jetty-ee9/jetty-ee9-cdi/src/main/java/module-info.java | 10 +++++++++- .../org.eclipse.jetty.ee9.webapp.Configuration | 2 +- .../src/main/java/module-info.java | 6 ++++++ .../jakarta.servlet.ServletContainerInitializer | 2 +- .../jakarta.servlet.ServletContainerInitializer | 1 - .../org.eclipse.jetty.ee9.webapp.Configuration | 2 +- 14 files changed, 46 insertions(+), 13 deletions(-) delete mode 100644 jetty-ee9/jetty-ee9-tests/jetty-ee9-test-owb-cdi-webapp/src/main/resources/META-INF/services/jakarta.servlet.ServletContainerInitializer diff --git a/jetty-core/jetty-http-spi/src/main/java/module-info.java b/jetty-core/jetty-http-spi/src/main/java/module-info.java index 6eec599bee8c..67f042747231 100644 --- a/jetty-core/jetty-http-spi/src/main/java/module-info.java +++ b/jetty-core/jetty-http-spi/src/main/java/module-info.java @@ -11,6 +11,9 @@ // ======================================================================== // +import com.sun.net.httpserver.spi.HttpServerProvider; +import org.eclipse.jetty.http.spi.JettyHttpServerProvider; + module org.eclipse.jetty.http.spi { requires transitive jdk.httpserver; @@ -19,4 +22,6 @@ requires transitive org.eclipse.jetty.util; exports org.eclipse.jetty.http.spi; -} \ No newline at end of file + + provides HttpServerProvider with JettyHttpServerProvider; +} diff --git a/jetty-core/jetty-websocket/jetty-websocket-core-common/src/main/java/module-info.java b/jetty-core/jetty-websocket/jetty-websocket-core-common/src/main/java/module-info.java index 5ddbcffdb6c6..274c29030efa 100644 --- a/jetty-core/jetty-websocket/jetty-websocket-core-common/src/main/java/module-info.java +++ b/jetty-core/jetty-websocket/jetty-websocket-core-common/src/main/java/module-info.java @@ -27,9 +27,10 @@ org.eclipse.jetty.util; // Export to DecoratedObjectFactory. uses org.eclipse.jetty.websocket.core.Extension; - + provides org.eclipse.jetty.websocket.core.Extension with org.eclipse.jetty.websocket.core.internal.FragmentExtension, + org.eclipse.jetty.websocket.core.internal.FrameCaptureExtension, org.eclipse.jetty.websocket.core.internal.IdentityExtension, org.eclipse.jetty.websocket.core.internal.PerMessageDeflateExtension, org.eclipse.jetty.websocket.core.internal.ValidationExtension; diff --git a/jetty-core/jetty-websocket/jetty-websocket-core-common/src/main/resources/META-INF/services/org.eclipse.jetty.websocket.core.Extension b/jetty-core/jetty-websocket/jetty-websocket-core-common/src/main/resources/META-INF/services/org.eclipse.jetty.websocket.core.Extension index 1e4404b3a0db..41f688cf2de0 100644 --- a/jetty-core/jetty-websocket/jetty-websocket-core-common/src/main/resources/META-INF/services/org.eclipse.jetty.websocket.core.Extension +++ b/jetty-core/jetty-websocket/jetty-websocket-core-common/src/main/resources/META-INF/services/org.eclipse.jetty.websocket.core.Extension @@ -1,5 +1,5 @@ -org.eclipse.jetty.websocket.core.internal.IdentityExtension org.eclipse.jetty.websocket.core.internal.FragmentExtension +org.eclipse.jetty.websocket.core.internal.FrameCaptureExtension +org.eclipse.jetty.websocket.core.internal.IdentityExtension org.eclipse.jetty.websocket.core.internal.PerMessageDeflateExtension org.eclipse.jetty.websocket.core.internal.ValidationExtension -org.eclipse.jetty.websocket.core.internal.FrameCaptureExtension \ No newline at end of file diff --git a/jetty-ee10/jetty-ee10-cdi/src/main/java/module-info.java b/jetty-ee10/jetty-ee10-cdi/src/main/java/module-info.java index 83bfa59c8c47..34c4213ea824 100644 --- a/jetty-ee10/jetty-ee10-cdi/src/main/java/module-info.java +++ b/jetty-ee10/jetty-ee10-cdi/src/main/java/module-info.java @@ -11,6 +11,11 @@ // ======================================================================== // +import jakarta.servlet.ServletContainerInitializer; +import org.eclipse.jetty.ee10.cdi.CdiConfiguration; +import org.eclipse.jetty.ee10.cdi.CdiServletContainerInitializer; +import org.eclipse.jetty.ee10.webapp.Configuration; + module org.eclipse.jetty.ee10.cdi { requires org.eclipse.jetty.ee10.annotations; @@ -19,4 +24,7 @@ requires transitive org.eclipse.jetty.ee10.webapp; exports org.eclipse.jetty.ee10.cdi; -} + + provides ServletContainerInitializer with CdiServletContainerInitializer; + provides Configuration with CdiConfiguration; +} diff --git a/jetty-ee10/jetty-ee10-plus/src/main/resources/META-INF/services/org.eclipse.jetty.ee10.webapp.Configuration b/jetty-ee10/jetty-ee10-plus/src/main/resources/META-INF/services/org.eclipse.jetty.ee10.webapp.Configuration index c5893f79068e..9b80e44d9504 100644 --- a/jetty-ee10/jetty-ee10-plus/src/main/resources/META-INF/services/org.eclipse.jetty.ee10.webapp.Configuration +++ b/jetty-ee10/jetty-ee10-plus/src/main/resources/META-INF/services/org.eclipse.jetty.ee10.webapp.Configuration @@ -1,2 +1,2 @@ -org.eclipse.jetty.ee10.plus.webapp.PlusConfiguration org.eclipse.jetty.ee10.plus.webapp.EnvConfiguration +org.eclipse.jetty.ee10.plus.webapp.PlusConfiguration diff --git a/jetty-ee10/jetty-ee10-quickstart/src/main/java/module-info.java b/jetty-ee10/jetty-ee10-quickstart/src/main/java/module-info.java index 3082e7122e39..daf2baf981f2 100644 --- a/jetty-ee10/jetty-ee10-quickstart/src/main/java/module-info.java +++ b/jetty-ee10/jetty-ee10-quickstart/src/main/java/module-info.java @@ -11,6 +11,10 @@ // ======================================================================== // +import org.eclipse.jetty.ee10.quickstart.QuickStartConfiguration; +import org.eclipse.jetty.ee10.quickstart.QuickStartGeneratorConfiguration; +import org.eclipse.jetty.ee10.webapp.Configuration; + module org.eclipse.jetty.ee10.quickstart { requires jakarta.servlet; @@ -19,4 +23,6 @@ requires transitive org.eclipse.jetty.ee10.annotations; exports org.eclipse.jetty.ee10.quickstart; + + provides Configuration with QuickStartConfiguration, QuickStartGeneratorConfiguration; } diff --git a/jetty-ee10/jetty-ee10-tests/jetty-ee10-test-jmx/jetty-ee10-jmx-webapp/src/main/resources/META-INF/services/jakarta.servlet.ServletContainerInitializer b/jetty-ee10/jetty-ee10-tests/jetty-ee10-test-jmx/jetty-ee10-jmx-webapp/src/main/resources/META-INF/services/jakarta.servlet.ServletContainerInitializer index 2e64dd7d038d..cb16405c7586 100644 --- a/jetty-ee10/jetty-ee10-tests/jetty-ee10-test-jmx/jetty-ee10-jmx-webapp/src/main/resources/META-INF/services/jakarta.servlet.ServletContainerInitializer +++ b/jetty-ee10/jetty-ee10-tests/jetty-ee10-test-jmx/jetty-ee10-jmx-webapp/src/main/resources/META-INF/services/jakarta.servlet.ServletContainerInitializer @@ -1 +1 @@ -org.eclipse.jetty.test.jmx.MyContainerInitializer \ No newline at end of file +org.eclipse.jetty.ee10.test.jmx.MyContainerInitializer diff --git a/jetty-ee10/jetty-ee10-webapp/src/main/resources/META-INF/services/org.eclipse.jetty.ee10.webapp.Configuration b/jetty-ee10/jetty-ee10-webapp/src/main/resources/META-INF/services/org.eclipse.jetty.ee10.webapp.Configuration index ab84beb12126..da52678deb8c 100644 --- a/jetty-ee10/jetty-ee10-webapp/src/main/resources/META-INF/services/org.eclipse.jetty.ee10.webapp.Configuration +++ b/jetty-ee10/jetty-ee10-webapp/src/main/resources/META-INF/services/org.eclipse.jetty.ee10.webapp.Configuration @@ -1,7 +1,7 @@ org.eclipse.jetty.ee10.webapp.FragmentConfiguration -org.eclipse.jetty.ee10.webapp.JettyWebXmlConfiguration org.eclipse.jetty.ee10.webapp.JaasConfiguration org.eclipse.jetty.ee10.webapp.JaspiConfiguration +org.eclipse.jetty.ee10.webapp.JettyWebXmlConfiguration org.eclipse.jetty.ee10.webapp.JmxConfiguration org.eclipse.jetty.ee10.webapp.JndiConfiguration org.eclipse.jetty.ee10.webapp.JspConfiguration diff --git a/jetty-ee9/jetty-ee9-cdi/src/main/java/module-info.java b/jetty-ee9/jetty-ee9-cdi/src/main/java/module-info.java index 7aa0460d970b..af1561d44e62 100644 --- a/jetty-ee9/jetty-ee9-cdi/src/main/java/module-info.java +++ b/jetty-ee9/jetty-ee9-cdi/src/main/java/module-info.java @@ -11,6 +11,11 @@ // ======================================================================== // +import jakarta.servlet.ServletContainerInitializer; +import org.eclipse.jetty.ee9.cdi.CdiConfiguration; +import org.eclipse.jetty.ee9.cdi.CdiServletContainerInitializer; +import org.eclipse.jetty.ee9.webapp.Configuration; + module org.eclipse.jetty.ee9.cdi { requires org.eclipse.jetty.ee9.annotations; @@ -18,4 +23,7 @@ requires transitive org.eclipse.jetty.ee9.webapp; exports org.eclipse.jetty.ee9.cdi; -} + + provides ServletContainerInitializer with CdiServletContainerInitializer; + provides Configuration with CdiConfiguration; +} diff --git a/jetty-ee9/jetty-ee9-plus/src/main/resources/META-INF/services/org.eclipse.jetty.ee9.webapp.Configuration b/jetty-ee9/jetty-ee9-plus/src/main/resources/META-INF/services/org.eclipse.jetty.ee9.webapp.Configuration index 63e25a62acd9..66af95fc4c62 100644 --- a/jetty-ee9/jetty-ee9-plus/src/main/resources/META-INF/services/org.eclipse.jetty.ee9.webapp.Configuration +++ b/jetty-ee9/jetty-ee9-plus/src/main/resources/META-INF/services/org.eclipse.jetty.ee9.webapp.Configuration @@ -1,2 +1,2 @@ -org.eclipse.jetty.ee9.plus.webapp.PlusConfiguration org.eclipse.jetty.ee9.plus.webapp.EnvConfiguration +org.eclipse.jetty.ee9.plus.webapp.PlusConfiguration diff --git a/jetty-ee9/jetty-ee9-quickstart/src/main/java/module-info.java b/jetty-ee9/jetty-ee9-quickstart/src/main/java/module-info.java index 473d170b13b6..67f1fc994711 100644 --- a/jetty-ee9/jetty-ee9-quickstart/src/main/java/module-info.java +++ b/jetty-ee9/jetty-ee9-quickstart/src/main/java/module-info.java @@ -11,6 +11,10 @@ // ======================================================================== // +import org.eclipse.jetty.ee9.quickstart.QuickStartConfiguration; +import org.eclipse.jetty.ee9.quickstart.QuickStartGeneratorConfiguration; +import org.eclipse.jetty.ee9.webapp.Configuration; + module org.eclipse.jetty.ee9.quickstart { requires jetty.servlet.api; @@ -19,4 +23,6 @@ requires transitive org.eclipse.jetty.ee9.annotations; exports org.eclipse.jetty.ee9.quickstart; + + provides Configuration with QuickStartConfiguration, QuickStartGeneratorConfiguration; } diff --git a/jetty-ee9/jetty-ee9-tests/jetty-ee9-test-jmx/jetty-ee9-jmx-webapp/src/main/resources/META-INF/services/jakarta.servlet.ServletContainerInitializer b/jetty-ee9/jetty-ee9-tests/jetty-ee9-test-jmx/jetty-ee9-jmx-webapp/src/main/resources/META-INF/services/jakarta.servlet.ServletContainerInitializer index 2e64dd7d038d..7b155f99e0ea 100644 --- a/jetty-ee9/jetty-ee9-tests/jetty-ee9-test-jmx/jetty-ee9-jmx-webapp/src/main/resources/META-INF/services/jakarta.servlet.ServletContainerInitializer +++ b/jetty-ee9/jetty-ee9-tests/jetty-ee9-test-jmx/jetty-ee9-jmx-webapp/src/main/resources/META-INF/services/jakarta.servlet.ServletContainerInitializer @@ -1 +1 @@ -org.eclipse.jetty.test.jmx.MyContainerInitializer \ No newline at end of file +org.eclipse.jetty.ee9.test.jmx.MyContainerInitializer diff --git a/jetty-ee9/jetty-ee9-tests/jetty-ee9-test-owb-cdi-webapp/src/main/resources/META-INF/services/jakarta.servlet.ServletContainerInitializer b/jetty-ee9/jetty-ee9-tests/jetty-ee9-test-owb-cdi-webapp/src/main/resources/META-INF/services/jakarta.servlet.ServletContainerInitializer deleted file mode 100644 index f4906b1d3d97..000000000000 --- a/jetty-ee9/jetty-ee9-tests/jetty-ee9-test-owb-cdi-webapp/src/main/resources/META-INF/services/jakarta.servlet.ServletContainerInitializer +++ /dev/null @@ -1 +0,0 @@ -org.eclipse.jetty.ee9.cdi.owb.OwbServletContainerInitializer \ No newline at end of file diff --git a/jetty-ee9/jetty-ee9-webapp/src/main/resources/META-INF/services/org.eclipse.jetty.ee9.webapp.Configuration b/jetty-ee9/jetty-ee9-webapp/src/main/resources/META-INF/services/org.eclipse.jetty.ee9.webapp.Configuration index 4bf4b020b439..937355a9e2e0 100644 --- a/jetty-ee9/jetty-ee9-webapp/src/main/resources/META-INF/services/org.eclipse.jetty.ee9.webapp.Configuration +++ b/jetty-ee9/jetty-ee9-webapp/src/main/resources/META-INF/services/org.eclipse.jetty.ee9.webapp.Configuration @@ -1,7 +1,7 @@ org.eclipse.jetty.ee9.webapp.FragmentConfiguration -org.eclipse.jetty.ee9.webapp.JettyWebXmlConfiguration org.eclipse.jetty.ee9.webapp.JaasConfiguration org.eclipse.jetty.ee9.webapp.JaspiConfiguration +org.eclipse.jetty.ee9.webapp.JettyWebXmlConfiguration org.eclipse.jetty.ee9.webapp.JmxConfiguration org.eclipse.jetty.ee9.webapp.JndiConfiguration org.eclipse.jetty.ee9.webapp.JspConfiguration