Merge pull request #3644 from eclipse/jetty-10.0.x-3197-jetty-websocket-jar

Fixes #3197 - Use jetty specific websocket API jar.
This commit is contained in:
Joakim Erdfelt 2019-05-14 09:18:42 -05:00 committed by GitHub
commit 9eea85e68e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 26 additions and 50 deletions

View File

@ -209,8 +209,8 @@
</dependency>
<!-- dependencies that jetty-all needs (some optional) -->
<dependency>
<groupId>javax.websocket</groupId>
<artifactId>javax.websocket-api</artifactId>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-javax-websocket-api</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.toolchain</groupId>

View File

@ -144,8 +144,8 @@
</dependency>
<!-- dependencies that jetty-all needs (some optional) -->
<dependency>
<groupId>javax.websocket</groupId>
<artifactId>javax.websocket-api</artifactId>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-javax-websocket-api</artifactId>
<scope>compile</scope>
</dependency>
<dependency>

View File

@ -315,8 +315,8 @@
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>javax.websocket</groupId>
<artifactId>javax.websocket-api</artifactId>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-javax-websocket-api</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>

View File

@ -18,7 +18,6 @@
package org.eclipse.jetty.osgi.test;
import java.io.InputStream;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
@ -30,15 +29,12 @@ import javax.websocket.RemoteEndpoint;
import javax.websocket.Session;
import javax.websocket.WebSocketContainer;
import aQute.bnd.osgi.Constants;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Configuration;
import org.ops4j.pax.exam.CoreOptions;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.tinybundles.core.TinyBundle;
import org.ops4j.pax.tinybundles.core.TinyBundles;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
@ -112,8 +108,6 @@ public class TestJettyOSGiBootWithJavaxWebSocket
@Test
public void testWebsocket() throws Exception
{
fixJavaxWebSocketApi();
startBundle(bundleContext, "org.eclipse.jetty.websocket.javax.websocket.common");
startBundle(bundleContext, "org.eclipse.jetty.websocket.javax.websocket.client");
startBundle(bundleContext, "org.eclipse.jetty.websocket.javax.websocket.server");
@ -143,24 +137,6 @@ public class TestJettyOSGiBootWithJavaxWebSocket
}
}
private void fixJavaxWebSocketApi() throws BundleException
{
// this is necessary because the javax.websocket-api jar does not have manifest headers
// that allow it to use ServiceLoader in osgi, this corrects that defect
TinyBundle bundle = TinyBundles.bundle();
bundle.set(Constants.FRAGMENT_HOST, "javax.websocket-api");
bundle.set(Constants.REQUIRE_CAPABILITY,
"osgi.serviceloader;filter:=\"(osgi.serviceloader=javax.websocket.ContainerProvider)\";resolution:=optional;cardinality:=multiple, osgi.extender; filter:=\"(osgi.extender=osgi.serviceloader.processor)\"");
bundle.set(Constants.BUNDLE_SYMBOLICNAME, "javax.websocket.api.fragment");
InputStream is = bundle.build(TinyBundles.withBnd());
bundleContext.installBundle("dummyLocation", is);
Bundle websocketApiBundle = TestOSGiUtil.getBundle(bundleContext, "javax.websocket-api");
assertNotNull(websocketApiBundle);
websocketApiBundle.update();
websocketApiBundle.start();
}
private void startBundle(BundleContext bundleContext, String symbolicName) throws BundleException
{
Bundle bundle = TestOSGiUtil.getBundle(bundleContext, symbolicName);

View File

@ -146,7 +146,7 @@ public class TestOSGiUtil
res.add(mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("javax-websocket-common").versionAsInProject().noStart());
res.add(mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("javax-websocket-client").versionAsInProject().noStart());
res.add(mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("javax-websocket-server").versionAsInProject().noStart());
res.add(mavenBundle().groupId("javax.websocket").artifactId("javax.websocket-api").versionAsInProject().noStart());
res.add(mavenBundle().groupId("org.eclipse.jetty.toolchain").artifactId("jetty-javax-websocket-api").versionAsInProject().noStart());
res.add(mavenBundle().groupId( "org.eclipse.jetty.osgi" ).artifactId( "jetty-osgi-boot" ).versionAsInProject().start());
return res;
}
@ -158,9 +158,9 @@ public class TestOSGiUtil
res.add(systemProperty("osgi.console.enable.builtin").value("true"));
return res;
}
public static List<Option> jspDependencies()
{
List<Option> res = new ArrayList<>();

View File

@ -28,8 +28,8 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>javax.websocket</groupId>
<artifactId>javax.websocket-api</artifactId>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-javax-websocket-api</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.toolchain</groupId>

View File

@ -24,7 +24,7 @@ module org.eclipse.jetty.websocket.javax.client
{
exports org.eclipse.jetty.websocket.javax.client;
requires javax.websocket.api;
requires jetty.websocket.api;
requires org.eclipse.jetty.client;
requires org.eclipse.jetty.http;
requires org.eclipse.jetty.io;

View File

@ -74,8 +74,8 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>javax.websocket</groupId>
<artifactId>javax.websocket-api</artifactId>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-javax-websocket-api</artifactId>
</dependency>
<dependency>

View File

@ -24,7 +24,7 @@ module org.eclipse.jetty.websocket.javax.common
exports org.eclipse.jetty.websocket.javax.common.messages;
exports org.eclipse.jetty.websocket.javax.common.util;
requires javax.websocket.api;
requires jetty.websocket.api;
requires org.eclipse.jetty.http;
requires org.eclipse.jetty.io;
requires org.eclipse.jetty.util;

View File

@ -33,8 +33,8 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>javax.websocket</groupId>
<artifactId>javax.websocket-api</artifactId>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-javax-websocket-api</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.toolchain</groupId>

View File

@ -29,7 +29,7 @@ module org.eclipse.jetty.websocket.javax.server
exports org.eclipse.jetty.websocket.javax.server;
requires jetty.servlet.api;
requires javax.websocket.api;
requires jetty.websocket.api;
requires org.eclipse.jetty.client;
requires org.eclipse.jetty.http;
requires org.eclipse.jetty.io;

View File

@ -33,8 +33,8 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>javax.websocket</groupId>
<artifactId>javax.websocket-api</artifactId>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-javax-websocket-api</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.toolchain</groupId>

View File

@ -908,9 +908,9 @@
<version>${servlet.api.version}</version>
</dependency>
<dependency>
<groupId>javax.websocket</groupId>
<artifactId>javax.websocket-api</artifactId>
<version>1.1</version>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-javax-websocket-api</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>

View File

@ -195,8 +195,8 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.websocket</groupId>
<artifactId>javax.websocket-api</artifactId>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-javax-websocket-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>