diff --git a/jetty-http/pom.xml b/jetty-http/pom.xml index ef1044bfeed0..eb622965c954 100644 --- a/jetty-http/pom.xml +++ b/jetty-http/pom.xml @@ -31,6 +31,20 @@ + + org.apache.felix + maven-bundle-plugin + true + + + osgi.serviceloader; filter:="(osgi.serviceloader=org.eclipse.jetty.http.HttpFieldPreEncoder)";resolution:=optional;cardinality:=multiple, osgi.extender; filter:="(osgi.extender=osgi.serviceloader.processor)", osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)" + + osgi.serviceloader; osgi.serviceloader=org.eclipse.jetty.http.HttpFieldPreEncoder + + + org.apache.maven.plugins maven-jar-plugin @@ -50,6 +64,7 @@ org.eclipse.jetty.http.* + diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/PreEncodedHttpField.java b/jetty-http/src/main/java/org/eclipse/jetty/http/PreEncodedHttpField.java index fc781da8639c..e6572929d496 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/PreEncodedHttpField.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/PreEncodedHttpField.java @@ -47,7 +47,7 @@ public class PreEncodedHttpField extends HttpField static { List encoders = new ArrayList<>(); - Iterator iter = ServiceLoader.load(HttpFieldPreEncoder.class,PreEncodedHttpField.class.getClassLoader()).iterator(); + Iterator iter = ServiceLoader.load(HttpFieldPreEncoder.class).iterator(); while (iter.hasNext()) { try @@ -118,4 +118,4 @@ public void putTo(ByteBuffer bufferInFillMode, HttpVersion version) { bufferInFillMode.put(_encodedField[index(version)]); } -} \ No newline at end of file +} diff --git a/jetty-http2/http2-hpack/pom.xml b/jetty-http2/http2-hpack/pom.xml index 15ad86d301ef..1b60745a259b 100644 --- a/jetty-http2/http2-hpack/pom.xml +++ b/jetty-http2/http2-hpack/pom.xml @@ -43,6 +43,21 @@ + + + org.apache.felix + maven-bundle-plugin + true + + + Http2 Hpack + osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)" + osgi.serviceloader;osgi.serviceloader=org.eclipse.jetty.http.HttpFieldPreEncoder + <_nouses>true + + + + diff --git a/jetty-osgi/test-jetty-osgi/pom.xml b/jetty-osgi/test-jetty-osgi/pom.xml index edbdf764d0be..2d70ebfa6cbf 100644 --- a/jetty-osgi/test-jetty-osgi/pom.xml +++ b/jetty-osgi/test-jetty-osgi/pom.xml @@ -306,6 +306,11 @@ http2-server ${project.version} + + org.eclipse.jetty.http2 + http2-hpack + ${project.version} + org.eclipse.jetty.osgi jetty-osgi-alpn diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootCore.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootCore.java index 02848f5ffd67..2ea77b53d6a0 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootCore.java +++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootCore.java @@ -106,7 +106,7 @@ public static List