Issue #7012 Replace geronimo spec jars with jakarta equivalents (#7013)

* Issue #7012 Replace geronimo spec jars with jakarta equivalents

Signed-off-by: Jan Bartel <janb@webtide.com>
This commit is contained in:
Jan Bartel 2021-11-02 10:37:27 +11:00 committed by GitHub
parent 5d2f204c0c
commit e0d465e39a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 89 additions and 108 deletions

View File

@ -67,7 +67,7 @@
<Bundle-Description>Test Webapp for Servlet 4.0 Features</Bundle-Description>
<!-- TODO Add 'org.eclipse.jetty.util;version="[9.4.19,9.4.20)",' below, once 9.4.19 is released with a fix for #3726 -->
<Import-Package>
javax.transaction*;version="[1.1,1.3)", javax.servlet*;version="[2.6,4.1)", org.eclipse.jetty*;version="[$(version;===;${parsedVersion.osgiVersion}),$(version;==+;${parsedVersion.osgiVersion}))", org.eclipse.jetty.webapp;version="[$(version;===;${parsedVersion.osgiVersion}),$(version;==+;${parsedVersion.osgiVersion}))";resolution:="optional", org.eclipse.jetty.plus.jndi;version="[$(version;===;${parsedVersion.osgiVersion}),$(version;==+;${parsedVersion.osgiVersion}))";resolution:="optional", com.acme;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}", *
javax.transaction*;version="[1.1,2.0)", javax.servlet*;version="[2.6,4.1)", org.eclipse.jetty*;version="[$(version;===;${parsedVersion.osgiVersion}),$(version;==+;${parsedVersion.osgiVersion}))", org.eclipse.jetty.webapp;version="[$(version;===;${parsedVersion.osgiVersion}),$(version;==+;${parsedVersion.osgiVersion}))";resolution:="optional", org.eclipse.jetty.plus.jndi;version="[$(version;===;${parsedVersion.osgiVersion}),$(version;==+;${parsedVersion.osgiVersion}))";resolution:="optional", com.acme;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}", *
</Import-Package>
<_nouses />
<Export-Package>com.acme.test;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}";-noimport:=true</Export-Package>

View File

@ -129,7 +129,11 @@
<version>${osgi-util-version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
<scope>test</scope>
</dependency>
<!-- Jetty OSGi Deps -->
<dependency>
<groupId>org.slf4j</groupId>
@ -190,14 +194,23 @@
<artifactId>jetty-servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jta_1.1_spec</artifactId>
<groupId>jakarta.transaction</groupId>
<artifactId>jakarta.transaction-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-atinject_1.0_spec</artifactId>
<version>${injection.bundle.version}</version>
<groupId>jakarta.interceptor</groupId>
<artifactId>jakarta.interceptor-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>jakarta.el</groupId>
<artifactId>jakarta.el-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>

View File

@ -58,7 +58,8 @@ public class TestJettyOSGiAnnotationParser
ArrayList<Option> options = new ArrayList<>();
options.add(TestOSGiUtil.optionalRemoteDebug());
options.add(CoreOptions.junitBundles());
options.addAll(TestOSGiUtil.coreJettyDependencies());
TestOSGiUtil.coreJettyDependencies(options);
TestOSGiUtil.coreJspDependencies(options);
//The jetty-alpn-client jars aren't used by this test, but as
//TestOSGiUtil.coreJettyDependencies deploys the jetty-client,
//we need them deployed to satisfy the dependency.

View File

@ -59,7 +59,7 @@ public class TestJettyOSGiBootContextAsService
options.add(CoreOptions.junitBundles());
options.addAll(TestOSGiUtil.configureJettyHomeAndPort(false, "jetty-http-boot-context-as-service.xml"));
options.add(CoreOptions.bootDelegationPackages("org.xml.sax", "org.xml.*", "org.w3c.*", "javax.xml.*"));
options.addAll(TestOSGiUtil.coreJettyDependencies());
TestOSGiUtil.coreJettyDependencies(options);
options.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-java-client").versionAsInProject().start());
options.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-client").versionAsInProject().start());

View File

@ -70,8 +70,8 @@ public class TestJettyOSGiBootHTTP2Conscrypt
"sun.security", "sun.security.x509", "sun.security.ssl"));
options.addAll(http2JettyDependencies());
options.addAll(TestOSGiUtil.coreJettyDependencies());
options.addAll(TestOSGiUtil.jspDependencies());
TestOSGiUtil.coreJettyDependencies(options);
TestOSGiUtil.coreJspDependencies(options);
//deploy a test webapp
options.add(mavenBundle().groupId("org.eclipse.jetty.demos").artifactId("demo-jsp-webapp").classifier("webbundle").versionAsInProject());
options.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-conscrypt-client").versionAsInProject().start());

View File

@ -67,8 +67,8 @@ public class TestJettyOSGiBootHTTP2JDK9
"com.sun.org.apache.xpath.internal.jaxp", "com.sun.org.apache.xpath.internal.objects"));
options.addAll(http2JettyDependencies());
options.addAll(TestOSGiUtil.coreJettyDependencies());
options.addAll(TestOSGiUtil.jspDependencies());
TestOSGiUtil.coreJettyDependencies(options);
TestOSGiUtil.coreJspDependencies(options);
//deploy a test webapp
options.add(mavenBundle().groupId("org.eclipse.jetty.demos").artifactId("demo-jsp-webapp").classifier("webbundle").versionAsInProject());
options.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-java-client").versionAsInProject().start());

View File

@ -66,11 +66,11 @@ public class TestJettyOSGiBootWebAppAsService
"com.sun.org.apache.xml.internal.utils", "com.sun.org.apache.xpath.internal",
"com.sun.org.apache.xpath.internal.jaxp", "com.sun.org.apache.xpath.internal.objects"));
options.addAll(TestOSGiUtil.coreJettyDependencies());
TestOSGiUtil.coreJettyDependencies(options);
TestOSGiUtil.coreJspDependencies(options);
options.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-java-client").versionAsInProject().start());
options.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-client").versionAsInProject().start());
options.addAll(TestOSGiUtil.jspDependencies());
options.addAll(testDependencies());
return options.toArray(new Option[0]);
}

View File

@ -61,21 +61,16 @@ public class TestJettyOSGiBootWithAnnotations
"com.sun.org.apache.xml.internal.utils", "com.sun.org.apache.xpath.internal",
"com.sun.org.apache.xpath.internal.jaxp", "com.sun.org.apache.xpath.internal.objects"));
options.addAll(TestOSGiUtil.coreJettyDependencies());
TestOSGiUtil.coreJettyDependencies(options);
TestOSGiUtil.coreJspDependencies(options);
options.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-java-client").versionAsInProject().start());
options.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-client").versionAsInProject().start());
options.addAll(jspDependencies());
options.addAll(annotationDependencies());
options.add(mavenBundle().groupId("org.eclipse.jetty.osgi").artifactId("test-jetty-osgi-fragment").versionAsInProject().noStart());
return options.toArray(new Option[0]);
}
public static List<Option> jspDependencies()
{
return TestOSGiUtil.jspDependencies();
}
public static List<Option> annotationDependencies()
{
List<Option> res = new ArrayList<>();

View File

@ -65,7 +65,8 @@ public class TestJettyOSGiBootWithBundle
options.add(CoreOptions.junitBundles());
options.addAll(configureJettyHomeAndPort());
options.add(CoreOptions.bootDelegationPackages("org.xml.sax", "org.xml.*", "org.w3c.*", "javax.xml.*"));
options.addAll(TestOSGiUtil.coreJettyDependencies());
TestOSGiUtil.coreJettyDependencies(options);
TestOSGiUtil.coreJspDependencies(options);
options.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-java-client").versionAsInProject().start());
options.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-client").versionAsInProject().start());

View File

@ -61,20 +61,15 @@ public class TestJettyOSGiBootWithJavaxWebSocket
"com.sun.org.apache.xml.internal.utils", "com.sun.org.apache.xpath.internal",
"com.sun.org.apache.xpath.internal.jaxp", "com.sun.org.apache.xpath.internal.objects"));
options.addAll(TestOSGiUtil.coreJettyDependencies());
TestOSGiUtil.coreJettyDependencies(options);
TestOSGiUtil.coreJspDependencies(options);
options.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-java-client").versionAsInProject().start());
options.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-client").versionAsInProject().start());
options.addAll(jspDependencies());
options.addAll(testJettyWebApp());
options.addAll(extraDependencies());
return options.toArray(new Option[0]);
}
public static List<Option> jspDependencies()
{
return TestOSGiUtil.jspDependencies();
}
public static List<Option> testJettyWebApp()
{
List<Option> res = new ArrayList<>();

View File

@ -57,22 +57,16 @@ public class TestJettyOSGiBootWithJsp
options.add(CoreOptions.systemPackages("com.sun.org.apache.xalan.internal.res", "com.sun.org.apache.xml.internal.utils",
"com.sun.org.apache.xml.internal.utils", "com.sun.org.apache.xpath.internal",
"com.sun.org.apache.xpath.internal.jaxp", "com.sun.org.apache.xpath.internal.objects"));
options.addAll(TestOSGiUtil.coreJettyDependencies());
TestOSGiUtil.coreJettyDependencies(options);
TestOSGiUtil.coreJspDependencies(options);
options.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-java-client").versionAsInProject().start());
options.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-client").versionAsInProject().start());
options.addAll(jspDependencies());
options.add(CoreOptions.cleanCaches(true));
options.add(mavenBundle().groupId("org.eclipse.jetty.demos").artifactId("demo-jsp-webapp").classifier("webbundle").versionAsInProject());
return options.toArray(new Option[0]);
}
public static List<Option> jspDependencies()
{
List<Option> res = new ArrayList<>(TestOSGiUtil.jspDependencies());
//test webapp bundle
res.add(mavenBundle().groupId("org.eclipse.jetty.demos").artifactId("demo-jsp-webapp").classifier("webbundle").versionAsInProject());
return res;
}
@Test
public void testJspDump() throws Exception
{

View File

@ -57,19 +57,14 @@ public class TestJettyOSGiBootWithWebSocket
"com.sun.org.apache.xml.internal.utils", "com.sun.org.apache.xpath.internal",
"com.sun.org.apache.xpath.internal.jaxp", "com.sun.org.apache.xpath.internal.objects"));
options.addAll(TestOSGiUtil.coreJettyDependencies());
TestOSGiUtil.coreJettyDependencies(options);
TestOSGiUtil.coreJspDependencies(options);
options.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-java-client").versionAsInProject().start());
options.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-client").versionAsInProject().start());
options.addAll(jspDependencies());
options.addAll(testJettyWebApp());
return options.toArray(new Option[0]);
}
public static List<Option> jspDependencies()
{
return TestOSGiUtil.jspDependencies();
}
public static List<Option> testJettyWebApp()
{
List<Option> res = new ArrayList<>();

View File

@ -62,7 +62,8 @@ public class TestJettyOSGiClasspathResources
"com.sun.org.apache.xml.internal.utils", "com.sun.org.apache.xpath.internal",
"com.sun.org.apache.xpath.internal.jaxp", "com.sun.org.apache.xpath.internal.objects"));
options.addAll(TestOSGiUtil.coreJettyDependencies());
TestOSGiUtil.coreJettyDependencies(options);
TestOSGiUtil.coreJspDependencies(options);
options.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-java-client").versionAsInProject().start());
options.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-alpn-client").versionAsInProject().start());

View File

@ -17,6 +17,7 @@ import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import org.eclipse.jetty.osgi.boot.OSGiServerConstants;
@ -25,6 +26,7 @@ import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.ops4j.pax.exam.CoreOptions;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.options.MavenArtifactProvisionOption;
import org.ops4j.pax.tinybundles.core.TinyBundle;
import org.ops4j.pax.tinybundles.core.TinyBundles;
import org.osgi.framework.Bundle;
@ -104,24 +106,14 @@ public class TestOSGiUtil
return options;
}
public static List<Option> provisionCoreJetty()
{
List<Option> res = new ArrayList<>();
// get the jetty home config from the osgi boot bundle.
res.add(CoreOptions.systemProperty("jetty.home.bundle").value("org.eclipse.jetty.osgi.boot"));
res.addAll(coreJettyDependencies());
return res;
}
public static Option optionalRemoteDebug()
{
return CoreOptions.when(Boolean.getBoolean("pax.exam.debug.remote"))
.useOptions(CoreOptions.vmOption("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"));
}
public static List<Option> coreJettyDependencies()
public static void coreJettyDependencies(List<Option> res)
{
List<Option> res = new ArrayList<>();
//enables a dump of the status of all deployed bundles
res.add(systemProperty("bundle.debug").value(Boolean.toString(Boolean.getBoolean(TestOSGiUtil.BUNDLE_DEBUG))));
@ -180,8 +172,10 @@ public class TestOSGiUtil
res.add(mavenBundle().groupId("org.ow2.asm").artifactId("asm-util").versionAsInProject().start());
res.add(mavenBundle().groupId("org.apache.aries.spifly").artifactId("org.apache.aries.spifly.dynamic.bundle").versionAsInProject().start());
res.add(mavenBundle().groupId("jakarta.annotation").artifactId("jakarta.annotation-api").versionAsInProject().start());
res.add(mavenBundle().groupId("org.apache.geronimo.specs").artifactId("geronimo-jta_1.1_spec").version("1.1.1").start());
res.add(mavenBundle().groupId("jakarta.enterprise").artifactId("jakarta.enterprise.cdi-api").versionAsInProject().start());
res.add(mavenBundle().groupId("jakarta.interceptor").artifactId("jakarta.interceptor-api").versionAsInProject().start());
res.add(mavenBundle().groupId("jakarta.transaction").artifactId("jakarta.transaction-api").versionAsInProject().start());
res.add(mavenBundle().groupId("jakarta.el").artifactId("jakarta.el-api").versionAsInProject().start());
res.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-util").versionAsInProject().start());
res.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-deploy").versionAsInProject().start());
@ -211,14 +205,30 @@ public class TestOSGiUtil
res.add(mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("websocket-javax-common").versionAsInProject().noStart());
res.add(mavenBundle().groupId("org.eclipse.jetty.osgi").artifactId("jetty-osgi-boot").versionAsInProject().start());
return res;
}
public static List<Option> jspDependencies()
public static void coreJspDependencies(List<Option> res)
{
List<Option> res = new ArrayList<>();
//jetty jsp bundles
/* The coreJettyDependencies() method needs to configure jakarta.el-api to satisfy the jakarta.transaction-api bundle.
* However, as we are now configuring the full jsp bundle set, we need to remove the jakarta.el-api
* bundle because the org.mortbay.jasper.apache-el bundle will be providing both the api and the impl.
*/
MavenArtifactProvisionOption option = mavenBundle().groupId("jakarta.el").artifactId("jakarta.el-api").versionAsInProject();
ListIterator<Option> iter = res.listIterator();
while (iter.hasNext())
{
Option o = iter.next();
if (o instanceof MavenArtifactProvisionOption)
{
if (((MavenArtifactProvisionOption)o).getURL().contains("jakarta.el-api"))
{
iter.remove();
}
}
}
res.add(mavenBundle().groupId("org.eclipse.jetty.orbit").artifactId("javax.servlet.jsp.jstl").versionAsInProject());
res.add(mavenBundle().groupId("org.mortbay.jasper").artifactId("apache-el").versionAsInProject().start());
res.add(mavenBundle().groupId("org.mortbay.jasper").artifactId("apache-jsp").versionAsInProject().start());
@ -226,9 +236,8 @@ public class TestOSGiUtil
res.add(mavenBundle().groupId("org.glassfish.web").artifactId("javax.servlet.jsp.jstl").versionAsInProject().start());
res.add(mavenBundle().groupId("org.eclipse.jdt").artifactId("ecj").versionAsInProject().start());
res.add(mavenBundle().groupId("org.eclipse.jetty.osgi").artifactId("jetty-osgi-boot-jsp").versionAsInProject().noStart());
return res;
}
protected static Bundle getBundle(BundleContext bundleContext, String symbolicName)
{
Map<String, Bundle> bundles = new HashMap<>();

41
pom.xml
View File

@ -39,11 +39,6 @@
<disruptor.version>3.4.2</disruptor.version>
<felix.version>7.0.1</felix.version>
<findbugs.jsr305.version>3.0.2</findbugs.jsr305.version>
<geronimo.annotation.spec.version>1.3</geronimo.annotation.spec.version>
<geronimo.atinject.spec.version>1.2</geronimo.atinject.spec.version>
<geronimo.interceptor.spec.version>1.2</geronimo.interceptor.spec.version>
<geronimo.jcdi.spec.version>1.3</geronimo.jcdi.spec.version>
<geronimo.jta.spec.version>1.1.1</geronimo.jta.spec.version>
<google.errorprone.version>2.9.0</google.errorprone.version>
<grpc.version>1.41.0</grpc.version>
<gson.version>2.8.8</gson.version>
@ -57,8 +52,10 @@
<jackson-databind.version>2.9.10.7</jackson-databind.version>
<jakarta.activation.api.version>1.2.2</jakarta.activation.api.version>
<jakarta.annotation.api.version>1.3.5</jakarta.annotation.api.version>
<jakarta.el-api.version>3.0.3</jakarta.el-api.version>
<jakarta.enterprise.cdi.api.version>2.0.2</jakarta.enterprise.cdi.api.version>
<jakarta.inject.api.version>1.0.5</jakarta.inject.api.version>
<jakarta.interceptor.api.version>1.2.5</jakarta.interceptor.api.version>
<jakarta.el-api.version>3.0.3</jakarta.el-api.version>
<jakarta.transaction-api.version>1.3.3</jakarta.transaction-api.version>
<jakarta.servlet.api.version>4.0.4</jakarta.servlet.api.version>
<jakarta.servlet.jsp.api.version>2.3.6</jakarta.servlet.jsp.api.version>
@ -1079,10 +1076,15 @@
<artifactId>jakarta.annotation-api</artifactId>
<version>${jakarta.annotation.api.version}</version>
</dependency>
<dependency>
<groupId>jakarta.interceptor</groupId>
<artifactId>jakarta.interceptor-api</artifactId>
<version>${jakarta.interceptor.api.version}</version>
</dependency>
<dependency>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
<version>1.0.4</version>
<version>${jakarta.inject.api.version}</version>
</dependency>
<dependency>
<groupId>jakarta.servlet</groupId>
@ -1149,31 +1151,6 @@
<artifactId>org.apache.felix.framework</artifactId>
<version>${felix.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-annotation_1.3_spec</artifactId>
<version>${geronimo.annotation.spec.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jcdi_2.0_spec</artifactId>
<version>${geronimo.jcdi.spec.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-atinject_1.0_spec</artifactId>
<version>${geronimo.atinject.spec.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-interceptor_1.2_spec</artifactId>
<version>${geronimo.interceptor.spec.version}</version>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jta_1.1_spec</artifactId>
<version>${geronimo.jta.spec.version}</version>
</dependency>
<dependency>
<groupId>org.apache.kerby</groupId>
<artifactId>kerb-simplekdc</artifactId>

View File

@ -38,20 +38,20 @@
<!-- included in webapp -->
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-annotation_1.3_spec</artifactId>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-jcdi_2.0_spec</artifactId>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-atinject_1.0_spec</artifactId>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-interceptor_1.2_spec</artifactId>
<groupId>jakarta.interceptor</groupId>
<artifactId>jakarta.interceptor-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>