Skip to content

Commit

Permalink
Merge branch 'jetty-12.0.x' into fix/jetty-12.0.x/transient-timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
gregw committed Nov 7, 2023
2 parents d1bc772 + b889082 commit a27c26c
Show file tree
Hide file tree
Showing 27 changed files with 350 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,15 @@ We recommend either the traditional link:{DISTGUIDE}[distribution] deployment ap
[[get-up-and-running]]
==== Get Up and Running

First, add `jetty-maven-plugin` to your `pom.xml` definition:
Since Jetty 12, Jetty Maven plugin is repackaged for corresponding Jakarta EE version with an `eeX` classifier in the groupId and artifactId. The `eeX` can be `ee8`,`ee9` or `ee10`, which stands for Jakarta EE 8, 9 and 10 respectively.

First, add `jetty-ee10-maven-plugin` to your `pom.xml` definition. Here's an example of how to do that for EE10:

[source,xml,subs="verbatim,attributes"]
----
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<groupId>org.eclipse.jetty.ee10</groupId>
<artifactId>jetty-ee10-maven-plugin</artifactId>
<version>{version}</version>
</plugin>
----
Expand Down Expand Up @@ -323,8 +325,8 @@ Here is an example, which turns on scanning for changes every ten seconds, and s
[source,xml,subs="verbatim,attributes"]
----
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<groupId>org.eclipse.jetty.ee10</groupId>
<artifactId>jetty-ee10-maven-plugin</artifactId>
<version>{version}</version>
<configuration>
<scan>10</scan>
Expand Down Expand Up @@ -421,8 +423,8 @@ Here is an example of a pom configuration for the plugin with the `run` goal:
<plugins>
...
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<groupId>org.eclipse.jetty.ee10</groupId>
<artifactId>jetty-ee10-maven-plugin</artifactId>
<version>{version}</version>
<configuration>
<webApp>
Expand Down Expand Up @@ -532,8 +534,8 @@ Here's an example of using the `pre-integration-test` and `post-integration-test
[source,xml,subs="verbatim,attributes"]
----
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<groupId>org.eclipse.jetty.ee10</groupId>
<artifactId>jetty-ee10-maven-plugin</artifactId>
<version>{version}</version>
<configuration>
<stopKey>foo</stopKey>
Expand Down Expand Up @@ -724,8 +726,8 @@ Here's a configuration example:
[source,xml,subs="verbatim,attributes"]
----
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<groupId>org.eclipse.jetty.ee10</groupId>
<artifactId>jetty-ee10-maven-plugin</artifactId>
<version>{version}</version>
<configuration>
<stopPort>9966</stopPort>
Expand Down Expand Up @@ -890,7 +892,7 @@ They are configured for the http://maven.apache.org/plugins/maven-war-plugin/ove

Then executing jetty:run would yield the following ordering of resources: `com.acme.X.war : com.acme.Y.war: ${project.basedir}/src/main/webapp`.
Note that the current project's resources are placed last in the ordering due to the empty <overlay/> element in the maven-war-plugin.
You can either use that, or specify the `<baseAppFirst>false</baseAppFirst>` parameter to the jetty-maven-plugin.
You can either use that, or specify the `<baseAppFirst>false</baseAppFirst>` parameter to the jetty-ee10-maven-plugin.

Moreover, due to the `exclusions` specified above, a request for the resource ` bar.jsp` would only be satisfied from `com.acme.Y.war.`
Similarly as `baz.jsp` is excluded, a request for it would result in a 404 error.
Expand Down Expand Up @@ -953,8 +955,8 @@ Here's an example of setting up the HashLoginService for a webapp:
[source,xml,subs="verbatim,attributes"]
----
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<groupId>org.eclipse.jetty.ee10</groupId>
<artifactId>jetty-ee10-maven-plugin</artifactId>
<version>{version}</version>
<configuration>
<scan>10</scan>
Expand Down Expand Up @@ -1007,20 +1009,20 @@ Putting the configuration in webapp A's `pom.xml`:
[source,xml,subs="verbatim,attributes"]
----
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<groupId>org.eclipse.jetty.ee10</groupId>
<artifactId>jetty-ee10-maven-plugin</artifactId>
<version>{version}</version>
<configuration>
<scan>10</scan>
<webApp>
<contextPath>/test</contextPath>
</webApp>
<contextHandlers>
<contextHandler implementation="org.eclipse.jetty.maven.plugin.MavenWebAppContext">
<contextHandler implementation="org.eclipse.jetty.ee10.maven.plugin.MavenWebAppContext">
<war>${project.basedir}../../B.war</war>
<contextPath>/B</contextPath>
</contextHandler>
<contextHandler implementation="org.eclipse.jetty.maven.plugin.MavenWebAppContext">
<contextHandler implementation="org.eclipse.jetty.ee10.maven.plugin.MavenWebAppContext">
<war>${project.basedir}../../C.war</war>
<contextPath>/C</contextPath>
</contextHandler>
Expand All @@ -1031,7 +1033,7 @@ Putting the configuration in webapp A's `pom.xml`:

[IMPORTANT]
====
If the `ContextHandler` you are deploying is a webapp, it is *essential* that you use an `org.eclipse.jetty.maven.plugin.MavenWebAppContext` instance rather than a standard `org.eclipse.jetty.ee9.webapp.WebAppContext` instance.
If the `ContextHandler` you are deploying is a webapp, it is *essential* that you use an `org.eclipse.jetty.ee10.maven.plugin.MavenWebAppContext` instance rather than a standard `org.eclipse.jetty.ee10.webapp.WebAppContext` instance.
Only the former will allow the webapp to function correctly in the maven environment.
====

Expand All @@ -1043,15 +1045,15 @@ Copy the `jetty.xml` file from the Jetty distribution, and then add WebAppContex
<Ref refid="Contexts">
<Call name="addHandler">
<Arg>
<New class="org.eclipse.jetty.maven.plugin.MavenWebAppContext">
<New class="org.eclipse.jetty.ee10.maven.plugin.MavenWebAppContext">
<Set name="contextPath">/B</Set>
<Set name="war">../../B.war</Set>
</New>
</Arg>
</Call>
<Call>
<Arg>
<New class="org.eclipse.jetty.maven.plugin.MavenWebAppContext">
<New class="org.eclipse.jetty.ee10.maven.plugin.MavenWebAppContext">
<Set name="contextPath">/C</Set>
<Set name="war">../../C.war</Set>
</New>
Expand All @@ -1065,8 +1067,8 @@ Then configure the location of this `jetty.xml` file into webapp A's jetty plugi
[source,xml,subs="verbatim,attributes"]
----
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<groupId>org.eclipse.jetty.ee10</groupId>
<artifactId>jetty-ee10-maven-plugin</artifactId>
<version>{version}</version>
<configuration>
<scan>10</scan>
Expand Down Expand Up @@ -1127,8 +1129,8 @@ Here's an example of how to specify System properties in the POM:
[source,xml]
----
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<groupId>org.eclipse.jetty.ee10</groupId>
<artifactId>jetty-ee10-maven-plugin</artifactId>
<configuration>
<systemProperties>
<fooprop>222</fooprop>
Expand Down Expand Up @@ -1157,8 +1159,8 @@ This can be configured on the plugin like so:
[source,xml]
----
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<groupId>org.eclipse.jetty.ee10</groupId>
<artifactId>jetty-ee10-maven-plugin</artifactId>
<configuration>
<systemPropertiesFile>${project.basedir}/mysys.props</systemPropertiesFile>
<webApp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.Session;
import org.eclipse.jetty.util.Callback;
import org.junit.Assert;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand All @@ -39,6 +38,7 @@
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.Matchers.startsWith;
import static org.junit.jupiter.api.Assertions.assertNull;

/**
* SessionHandlerTest
Expand Down Expand Up @@ -656,7 +656,7 @@ public void testUriParameterOnly() throws Exception
response = HttpTester.parseResponse(endPoint.getResponse());
assertThat(response.getStatus(), equalTo(200));

Assert.assertNull(response.get(HttpHeader.SET_COOKIE));
assertNull(response.get(HttpHeader.SET_COOKIE));

String content = response.getContent();
assertThat(content, startsWith("Session="));
Expand Down
10 changes: 10 additions & 0 deletions jetty-core/jetty-websocket/jetty-websocket-core-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
Expand Down
5 changes: 0 additions & 5 deletions jetty-ee10/jetty-ee10-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-artifact-transfer</artifactId>
<version>${maven-artifact-transfer.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-xml</artifactId>
Expand Down
8 changes: 8 additions & 0 deletions jetty-ee10/jetty-ee10-osgi/test-jetty-ee10-osgi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<properties>
<assembly-directory>target/distribution</assembly-directory>
<bundle-symbolic-name>${project.groupId}.boot.test.osgi</bundle-symbolic-name>
<!-- too many duplicates with osgi jars... -->
<duplicate-finder.skip>true</duplicate-finder.skip>
<maven.deploy.skip>true</maven.deploy.skip>
<maven.javadoc.skip>true</maven.javadoc.skip>
</properties>
Expand Down Expand Up @@ -415,6 +417,12 @@
<groupId>org.ops4j.pax.exam</groupId>
<artifactId>pax-exam-junit4</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.ops4j.pax.exam</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@
<dependency>
<groupId>org.eclipse.jetty.tests</groupId>
<artifactId>jetty-test-session-common</artifactId>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.toolchain</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,17 @@
<groupId>org.infinispan</groupId>
<artifactId>infinispan-client-hotrod</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.wildfly.security</groupId>
<artifactId>wildfly-elytron</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.wildfly.common</groupId>
<artifactId>wildfly-common</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
Expand Down Expand Up @@ -128,6 +128,41 @@
<artifactId>testcontainers</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly.security</groupId>
<artifactId>wildfly-elytron-sasl-digest</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly.security</groupId>
<artifactId>wildfly-elytron-sasl-external</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly.security</groupId>
<artifactId>wildfly-elytron-sasl-gs2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly.security</groupId>
<artifactId>wildfly-elytron-sasl-gssapi</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly.security</groupId>
<artifactId>wildfly-elytron-sasl-oauth2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly.security</groupId>
<artifactId>wildfly-elytron-sasl-plain</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wildfly.security</groupId>
<artifactId>wildfly-elytron-sasl-scram</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
4 changes: 4 additions & 0 deletions jetty-ee8/jetty-ee8-glassfish-jstl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
<groupId>javax.servlet.jsp</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

Expand Down
5 changes: 0 additions & 5 deletions jetty-ee8/jetty-ee8-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-tools-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-artifact-transfer</artifactId>
<version>${maven-artifact-transfer.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-xml</artifactId>
Expand Down
2 changes: 2 additions & 0 deletions jetty-ee8/jetty-ee8-osgi/test-jetty-ee8-osgi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
<assembly-directory>target/distribution</assembly-directory>
<bundle-symbolic-name>${project.groupId}.boot.test.osgi</bundle-symbolic-name>
<bundle.debug>true</bundle.debug>
<!-- too many duplicates with osgi jars... -->
<duplicate-finder.skip>true</duplicate-finder.skip>
<ee9.module>jetty-ee9-osgi/test-jetty-ee9-osgi</ee9.module>
<el.artifactId>apache-el</el.artifactId>
<el.groupId>org.mortbay.jasper</el.groupId>
Expand Down
2 changes: 1 addition & 1 deletion jetty-ee8/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<javax.mail.glassfish.version>1.4.1.v201005082020</javax.mail.glassfish.version>
<jetty.servlet.api.version>4.0.6</jetty.servlet.api.version>
<jsp.impl.version>9.0.52</jsp.impl.version>
<modify-sources-plugin.version>1.0.8</modify-sources-plugin.version>
<modify-sources-plugin.version>1.0.9</modify-sources-plugin.version>
<sonar.skip>true</sonar.skip>
<weld.version>3.1.9.Final</weld.version>

Expand Down
15 changes: 6 additions & 9 deletions jetty-ee9/jetty-ee9-demos/jetty-ee9-demo-embedded/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@
<dependency>
<groupId>org.eclipse.jetty.ee9</groupId>
<artifactId>jetty-ee9-plus</artifactId>
<exclusions>
<exclusion>
<groupId>jakarta.el</groupId>
<artifactId>jakarta.el-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.ee9</groupId>
Expand All @@ -85,15 +91,6 @@
<version>${project.version}</version>
<type>war</type>
</dependency>
<!-- sounds cyclic -->
<!--
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-home</artifactId>
<type>zip</type>
<scope>test</scope>
</dependency>
-->
<dependency>
<groupId>org.eclipse.jetty.ee9.demos</groupId>
<artifactId>jetty-ee9-demo-jndi-webapp</artifactId>
Expand Down
Loading

0 comments on commit a27c26c

Please sign in to comment.