Skip to content

Commit

Permalink
Issue #3162 - Use Jetty specific Servlet API jar.
Browse files Browse the repository at this point in the history
* Updated module-info.java to reference the "jetty.servlet.api" module.
* Updated POMs to reference the o.e.j.toolchain:jetty-servlet-api artifact.
* Removed references to jetty-schemas.jar.
* Updated attribute "org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern"
  to match the new Jetty Servlet API jar.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
  • Loading branch information
sbordet committed Nov 29, 2018
1 parent aeb200e commit bfa2dbf
Show file tree
Hide file tree
Showing 85 changed files with 134 additions and 211 deletions.
2 changes: 1 addition & 1 deletion NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ The following artifacts are CDDL + GPLv2 with classpath exception.

https://glassfish.dev.java.net/nonav/public/CDDL+GPL.html

org.eclipse.jetty.toolchain:jetty-schemas
org.eclipse.jetty.toolchain:jetty-servlet-api

------
Assorted
Expand Down
4 changes: 2 additions & 2 deletions aggregates/jetty-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@
<artifactId>javax.websocket-api</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-servlet-api</artifactId>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
Expand Down
4 changes: 2 additions & 2 deletions aggregates/jetty-websocket-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-servlet-api</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
6 changes: 1 addition & 5 deletions apache-jsp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,7 @@
</dependency>
<dependency>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-schemas</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<artifactId>jetty-servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.mortbay.jasper</groupId>
Expand Down
2 changes: 1 addition & 1 deletion apache-jsp/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
requires java.xml;
requires org.eclipse.jetty.util;
requires org.mortbay.apache.jasper;
requires static javax.servlet.api;
requires static jetty.servlet.api;

provides Log with JuliLog;
provides ServletContainerInitializer with JettyJasperInitializer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static void init(WebAppContext context, URI baseUri, File scratchDir)
{
context.setAttribute("javax.servlet.context.tempdir", scratchDir);
context.setAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",
".*/javax.servlet-[^/]*\\.jar$|.*/servlet-api-[^/]*\\.jar$|.*javax.servlet.jsp.jstl-[^/]*\\.jar|.*taglibs-standard-impl-.*\\.jar");
".*/javax.servlet-[^/]*\\.jar$|.*/[^/]*servlet-api-[^/]*\\.jar$|.*javax.servlet.jsp.jstl-[^/]*\\.jar|.*taglibs-standard-impl-.*\\.jar");
context.setWar(baseUri.toASCIIString());
context.setResourceBase(baseUri.toASCIIString());
}
Expand Down
4 changes: 2 additions & 2 deletions examples/async-rest/async-rest-jar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-servlet-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
4 changes: 2 additions & 2 deletions examples/async-rest/async-rest-webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-servlet-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static final void main( String args[] ) throws Exception
webapp.setWar(warFile.getAbsolutePath());
webapp.setAttribute(
"org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",
".*/javax.servlet-[^/]*\\.jar$|.*/servlet-api-[^/]*\\.jar$");
".*/javax.servlet-[^/]*\\.jar$|.*/[^/]*servlet-api-[^/]*\\.jar$");
server.setHandler(webapp);

// Register new transaction manager in JNDI
Expand Down
2 changes: 1 addition & 1 deletion jetty-annotations/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

requires java.naming;
requires java.annotation;
requires javax.servlet.api;
requires jetty.servlet.api;
requires org.objectweb.asm;
requires org.eclipse.jetty.util;
requires org.eclipse.jetty.http;
Expand Down
7 changes: 2 additions & 5 deletions jetty-ant/src/test/config/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,9 @@
<loginServices>
<hashLoginService name="Test Realm" config="realm.properties"/>
</loginServices>
<webApp
war="test.war"
contextpath="/test" >
<webApp war="test.war" contextpath="/test" >
<attributes>
<attribute name="org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern" value=".*/servlet-api-[^/]*\.jar$"/>

<attribute name="org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern" value=".*/[^/]*servlet-api-[^/]*\.jar$"/>
</attributes>
</webApp>
</jetty.run>
Expand Down
8 changes: 4 additions & 4 deletions jetty-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
<configuration>
<argLine>
@{argLine}
--add-reads org.eclipse.jetty.client=javax.servlet.api
--add-reads org.eclipse.jetty.client=jetty.servlet.api
--add-modules java.security.jgss
--add-modules javax.servlet.api
--add-modules jetty.servlet.api
--add-modules org.eclipse.jetty.jmx
--add-modules org.slf4j
</argLine>
Expand Down Expand Up @@ -120,8 +120,8 @@
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-servlet-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<Call name="setContextAttribute">
<Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg>
<Arg>.*/servlet-api-[^/]*\.jar$</Arg>
<Arg>.*/[^/]*servlet-api-[^/]*\.jar$</Arg>
</Call>

<Call id="webappprovider" name="addAppProvider">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ Version Information on 11 entries in the classpath.
Note: order presented here is how they would appear on the classpath.
changes to the --module=name command line options will be reflected here.
0: 3.1.0 | ${jetty.home}/lib/servlet-api-3.1.jar
1: 3.1.0.M0 | ${jetty.home}/lib/jetty-schemas-3.1.jar
2: {VERSION} | ${jetty.home}/lib/jetty-http-{VERSION}.jar
3: {VERSION} | ${jetty.home}/lib/jetty-server-{VERSION}.jar
4: {VERSION} | ${jetty.home}/lib/jetty-xml-{VERSION}.jar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ Modules for tag '*':
Depend: threadpool
Optional: jvm, ext, resources, logging
LIB: lib/servlet-api-3.1.jar
LIB: lib/jetty-schemas-3.1.jar
LIB: lib/jetty-http-${jetty.version}.jar
LIB: lib/jetty-server-${jetty.version}.jar
LIB: lib/jetty-xml-${jetty.version}.jar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ Note: order presented here is how they would appear on the classpath.
2: {VERSION} | ${jetty.base}/lib/ext/test-mock-resources-{VERSION}.jar
3: (dir) | ${jetty.home}/resources
4: 3.1.0 | ${jetty.home}/lib/servlet-api-3.1.jar
5: 3.1.RC0 | ${jetty.home}/lib/jetty-schemas-3.1.jar
6: {VERSION} | ${jetty.home}/lib/jetty-http-{VERSION}.jar
7: {VERSION} | ${jetty.home}/lib/jetty-continuation-{VERSION}.jar
8: {VERSION} | ${jetty.home}/lib/jetty-server-{VERSION}.jar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ Note: order presented here is how they would appear on the classpath.
2: {VERSION} | ${jetty.base}/lib/ext/test-mock-resources-{VERSION}.jar
3: (dir) | ${jetty.home}/resources
4: 3.1.0 | ${jetty.home}/lib/servlet-api-3.1.jar
5: 3.1.RC0 | ${jetty.home}/lib/jetty-schemas-3.1.jar
6: {VERSION} | ${jetty.home}/lib/jetty-http-{VERSION}.jar
7: {VERSION} | ${jetty.home}/lib/jetty-continuation-{VERSION}.jar
8: {VERSION} | ${jetty.home}/lib/jetty-server-{VERSION}.jar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,13 @@ This will give an output looking something like this (broken in sections for cla
[source, screen, subs="{sub-order}"]
....
/opt/openjdk-11+28/bin/java
--module-path /opt/jetty/lib/servlet-api-3.1.jar:/opt/jetty/lib/jetty-schemas-3.1.jar:/opt/jetty/lib/jetty-http-9.4.13-SNAPSHOT.jar:...
--patch-module servlet.api=/opt/jetty/lib/jetty-schemas-3.1.jar
--module-path /opt/jetty/lib/jetty-servlet-api-4.0.0.jar:/opt/jetty/lib/jetty-http-9.4.13-SNAPSHOT.jar:...
--module org.eclipse.jetty.xml/org.eclipse.jetty.xml.XmlConfiguration /opt/jetty/etc/jetty-threadpool.xml /opt/jetty/etc/jetty.xml ...
....

The `--module-path` option specifies the list of Jetty jars.
This list depends on the Jetty modules that have been enabled via the link:#startup-modules[`--add-to-start`] command.

The `--patch-module` option is necessary for Servlet and JSP Containers to find XML DTDs and XML Schemas required to validate the various XML files present in web applications (such as `web.xml` and others).

The `--module` option tells the JVM to run main class `XmlConfiguration` from the `org.eclipse.jetty.xml` module, with the given XML files as program arguments.

When the JVM starts, module `org.eclipse.jetty.xml` is added to the set of JPMS _root modules_; all other Jetty modules, being automatic, will be resolved and added to the module graph.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ Version Information on 7 entries in the classpath.
Note: order presented here is how they would appear on the classpath.
changes to the --module=name command line options will be reflected here.
0: 3.1.0 | ${jetty.home}/lib/servlet-api-3.1.jar
1: 3.1.RC0 | ${jetty.home}/lib/jetty-schemas-3.1.jar
2: {VERSION} | ${jetty.home}/lib/jetty-http-{VERSION}.jar
3: {VERSION} | ${jetty.home}/lib/jetty-server-{VERSION}.jar
4: {VERSION} | ${jetty.home}/lib/jetty-xml-{VERSION}.jar
Expand Down Expand Up @@ -193,7 +192,6 @@ The following is the equivalent Java command line for what the `start.jar` boots
-Djetty.base=$JETTY_BASE \
-cp \
$JETTY_HOME/lib/servlet-api-3.1.jar\
:$JETTY_HOME/lib/jetty-schemas-3.1.jar\
:$JETTY_HOME/lib/jetty-http-$JETTY_VERSION.jar\
:$JETTY_HOME/lib/jetty-server-$JETTY_VERSION.jar \
:$JETTY_HOME/lib/jetty-xml-$JETTY_VERSION.jar\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ Version Information on 11 entries in the classpath.
: order presented here is how they would appear on the classpath.
changes to the --module=name command line options will be reflected here.
0: 3.1.0 | ${jetty.home}/lib/servlet-api-3.1.jar
1: 3.1.RC0 | ${jetty.home}/lib/jetty-schemas-3.1.jar
2: {VERSION} | ${jetty.home}/lib/jetty-http-{VERSION}.jar
3: {VERSION} | ${jetty.home}/lib/jetty-continuation-{VERSION}.jar
4: {VERSION} | ${jetty.home}/lib/jetty-server-{VERSION}.jar
Expand Down Expand Up @@ -385,7 +384,6 @@ Module: security
Module: server
LIB: lib/servlet-api-3.1.jar
LIB: lib/jetty-schemas-3.1.jar
LIB: lib/jetty-http-${jetty.version}.jar
LIB: lib/jetty-continuation-${jetty.version}.jar
LIB: lib/jetty-server-${jetty.version}.jar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ Defaults to "true".
Controls whether any overlaid wars are added before or after the original base resource(s) of the webapp.
See the section on link:#using-overlaid-wars[overlaid wars] for more information.
containerIncludeJarPattern;;
Defaults to `.*/javax.servlet-[^/]*\.jar$|.*/servlet-api-[^/]*\.jar$|.*javax.servlet.jsp.jstl-[^/]*\.jar|.*taglibs-standard-impl-.*\.jar`.
Defaults to `.*/javax.servlet-[^/]*\.jar$|.*/[^/]*servlet-api-[^/]*\.jar$|.*javax.servlet.jsp.jstl-[^/]*\.jar|.*taglibs-standard-impl-.*\.jar`.
This is a pattern that is applied to the names of the jars on the container's classpath (ie the classpath of the plugin, not that of the webapp) that should be scanned for fragments, tlds, annotations etc.
This is analogous to the context attribute link:#container-include-jar-pattern[org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern] that is documented link:#container-include-jar-pattern[here].
You can define extra patterns of jars that will be included in the scan.
Expand Down
4 changes: 2 additions & 2 deletions jetty-fcgi/fcgi-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-servlet-api</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.fcgi</groupId>
Expand Down
2 changes: 1 addition & 1 deletion jetty-fcgi/fcgi-server/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
exports org.eclipse.jetty.fcgi.server;
exports org.eclipse.jetty.fcgi.server.proxy;

requires javax.servlet.api;
requires jetty.servlet.api;
requires org.eclipse.jetty.util;
requires org.eclipse.jetty.http;
requires org.eclipse.jetty.io;
Expand Down
14 changes: 3 additions & 11 deletions jetty-home/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -284,21 +284,13 @@
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${servlet.api.version}</version>
<overWrite>true</overWrite>
<outputDirectory>${assembly-directory}/lib</outputDirectory>
<destFileName>servlet-api-4.0.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-schemas</artifactId>
<version>${servlet.schema.version}</version>
<artifactId>jetty-servlet-api</artifactId>
<version>${servlet.api.version}</version>
<overWrite>true</overWrite>
<outputDirectory>${assembly-directory}/lib</outputDirectory>
<destFileName>jetty-schemas-4.0.jar</destFileName>
<destFileName>jetty-servlet-api-${servlet.api.version}.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
Expand Down
6 changes: 3 additions & 3 deletions jetty-http/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-servlet-api</artifactId>
<scope>provided</scope>
</dependency>

Expand All @@ -44,7 +44,7 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>@{argLine} --add-modules javax.servlet.api</argLine>
<argLine>@{argLine} --add-modules jetty.servlet.api</argLine>
</configuration>
</plugin>
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion jetty-http/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

requires org.eclipse.jetty.util;
requires org.eclipse.jetty.io;
requires static javax.servlet.api;
requires static jetty.servlet.api;

uses HttpFieldPreEncoder;

Expand Down
4 changes: 2 additions & 2 deletions jetty-http2/http2-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
<configuration>
<argLine>
@{argLine}
--add-reads org.eclipse.jetty.http2.client=javax.servlet.api
--add-modules javax.servlet.api
--add-reads org.eclipse.jetty.http2.client=jetty.servlet.api
--add-modules jetty.servlet.api
</argLine>
</configuration>
</plugin>
Expand Down
4 changes: 2 additions & 2 deletions jetty-http2/http2-http-client-transport/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
<configuration>
<argLine>
@{argLine}
--add-reads org.eclipse.jetty.http2.http.client.transport=javax.servlet.api
--add-modules javax.servlet.api
--add-reads org.eclipse.jetty.http2.http.client.transport=jetty.servlet.api
--add-modules jetty.servlet.api
</argLine>
</configuration>
</plugin>
Expand Down
4 changes: 2 additions & 2 deletions jetty-http2/http2-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
<configuration>
<argLine>
@{argLine}
--add-reads org.eclipse.jetty.http2.server=javax.servlet.api
--add-modules javax.servlet.api
--add-reads org.eclipse.jetty.http2.server=jetty.servlet.api
--add-modules jetty.servlet.api
</argLine>
</configuration>
</plugin>
Expand Down
2 changes: 1 addition & 1 deletion jetty-jaas/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
exports org.eclipse.jetty.jaas.spi;

requires java.naming;
requires javax.servlet.api;
requires jetty.servlet.api;
requires org.eclipse.jetty.util;
requires org.eclipse.jetty.server;
requires org.eclipse.jetty.security;
Expand Down
2 changes: 1 addition & 1 deletion jetty-jaspi/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
exports org.eclipse.jetty.security.jaspi.callback;
exports org.eclipse.jetty.security.jaspi.modules;

requires javax.servlet.api;
requires jetty.servlet.api;
requires javax.security.auth.message;
requires org.eclipse.jetty.util;
requires org.eclipse.jetty.http;
Expand Down
4 changes: 2 additions & 2 deletions jetty-maven-plugin/src/it/it-parent-pom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<version>2.6</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-servlet-api</artifactId>
<version>@servlet.api.version@</version>
<scope>provided</scope>
</dependency>
Expand Down
4 changes: 2 additions & 2 deletions jetty-maven-plugin/src/it/jetty-cdi-run-forked/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
<artifactId>weld-servlet</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<groupId>org.eclipse.jetty.toolchain</groupId>
<artifactId>jetty-servlet-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
Loading

0 comments on commit bfa2dbf

Please sign in to comment.