Skip to content

Commit

Permalink
Upgrade to Jetty 12.0.3, 10.0.18, 11.0.18 and cleanup some pom depend…
Browse files Browse the repository at this point in the history
…encies as well, use correcly shinwrap bom to have real control on the dependencies used (#166)

* Upgrade to Jetty 12.0.3 and cleanup some pom dependencies as well, use correcly shinwrap bom to have real control on the dependencies used
* upgrade to 10/11.0.18
---------

Signed-off-by: Olivier Lamy <[email protected]>
  • Loading branch information
olamy authored Nov 28, 2023
1 parent 104dbde commit 9367a2c
Show file tree
Hide file tree
Showing 11 changed files with 214 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
java-version: ${{ matrix.java }}
cache: 'maven'
- name: Set up Maven
run: mvn --errors --batch-mode --show-version wrapper:wrapper "-Dmaven=3.8.6"
run: mvn --errors --batch-mode --show-version wrapper:wrapper "-Dmaven=3.9.5"

- name: Build with Maven
run: ./mvnw install -e -B -V javadoc:jar
43 changes: 37 additions & 6 deletions jetty-embedded-10/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<description>Jetty Embedded 10.0.x container integration for the Arquillian project</description>

<properties>
<version.jetty>10.0.12</version.jetty>
<version.jetty>10.0.18</version.jetty>
<version.weld>3.1.9.Final</version.weld>

<!-- Jetty 10 need Java 11 -->
Expand Down Expand Up @@ -75,6 +75,15 @@
<artifactId>arquillian-testenricher-initialcontext</artifactId>
</dependency>

<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-xml</artifactId>
</dependency>

<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
Expand Down Expand Up @@ -145,21 +154,43 @@
</dependency>

<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-depchain</artifactId>
<type>pom</type>
<groupId>org.jboss.shrinkwrap.descriptors</groupId>
<artifactId>shrinkwrap-descriptors-impl-javaee</artifactId>
<scope>test</scope>
</dependency>

<!-- all the shrinkwrap -->
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-spi</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-api-maven</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-spi-maven</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.descriptors</groupId>
<artifactId>shrinkwrap-descriptors-impl-javaee</artifactId>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven-archive</artifactId>
<scope>test</scope>
</dependency>

<!-- Without this the shrinkwrap layer tries to download it in offline mode and fails -->
<dependency>
<groupId>org.jboss.spec.javax.el</groupId>
Expand Down
46 changes: 40 additions & 6 deletions jetty-embedded-11/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<description>Jetty Embedded 11.0.x container integration for the Arquillian project</description>

<properties>
<version.jetty>11.0.12</version.jetty>
<version.jetty>11.0.18</version.jetty>
<version.weld>4.0.3.Final</version.weld>

<!-- Jetty 11 need Java 11 -->
Expand Down Expand Up @@ -76,6 +76,15 @@
<artifactId>arquillian-testenricher-initialcontext</artifactId>
</dependency>

<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-xml</artifactId>
</dependency>

<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
Expand Down Expand Up @@ -154,11 +163,32 @@
</dependency>

<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-depchain</artifactId>
<type>pom</type>
<groupId>org.jboss.shrinkwrap.descriptors</groupId>
<artifactId>shrinkwrap-descriptors-impl-javaee</artifactId>
<scope>test</scope>
</dependency>

<!-- all the shrinkwrap -->
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-spi</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-api-maven</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-spi-maven</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
Expand All @@ -168,11 +198,15 @@
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</exclusion>
<exclusion>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.descriptors</groupId>
<artifactId>shrinkwrap-descriptors-impl-javaee</artifactId>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven-archive</artifactId>
<scope>test</scope>
</dependency>

Expand Down
45 changes: 39 additions & 6 deletions jetty-embedded-12-ee10/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@
<artifactId>arquillian-testenricher-initialcontext</artifactId>
</dependency>

<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-xml</artifactId>
</dependency>

<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
Expand All @@ -109,7 +118,6 @@
<dependency>
<groupId>org.eclipse.jetty.ee10</groupId>
<artifactId>jetty-ee10-plus</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
Expand Down Expand Up @@ -179,11 +187,32 @@
</dependency>

<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-depchain</artifactId>
<type>pom</type>
<groupId>org.jboss.shrinkwrap.descriptors</groupId>
<artifactId>shrinkwrap-descriptors-impl-javaee</artifactId>
<scope>test</scope>
</dependency>

<!-- all the shrinkwrap -->
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-spi</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-api-maven</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-spi-maven</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
Expand All @@ -193,11 +222,15 @@
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</exclusion>
<exclusion>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.descriptors</groupId>
<artifactId>shrinkwrap-descriptors-impl-javaee</artifactId>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven-archive</artifactId>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public ProtocolMetaData deploy(final Archive<?> archive) throws DeploymentExcept
WebAppContext webAppContext = getWebAppContext(app);

if (containerConfig.areMimeTypesSet()) {
containerConfig.getMimeTypes().forEach((s, s2) -> webAppContext.getMimeTypes().addInferred(s, s2));
containerConfig.getMimeTypes().forEach((s, s2) -> webAppContext.getMimeTypes().addMimeMapping(s, s2));
}

deployer.addApp(app);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ public void shouldBeEncodingDefined() throws Exception {
String body = JettyEmbeddedClientTestCase.readAllAndClose(new URL(encodingUrl, MyEncodingServlet.URL_PATTERN).openStream());

assertThat(
"Should contains iso-8859-1",
"Should contains ISO-8859-1",
body,
StringContains.containsString("iso-8859-1"));
StringContains.containsStringIgnoringCase("ISO-8859-1"));
}
}
44 changes: 39 additions & 5 deletions jetty-embedded-12-ee9/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@
<artifactId>arquillian-testenricher-initialcontext</artifactId>
</dependency>

<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-xml</artifactId>
</dependency>

<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
Expand Down Expand Up @@ -166,11 +175,32 @@
</dependency>

<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-depchain</artifactId>
<type>pom</type>
<groupId>org.jboss.shrinkwrap.descriptors</groupId>
<artifactId>shrinkwrap-descriptors-impl-javaee</artifactId>
<scope>test</scope>
</dependency>

<!-- all the shrinkwrap -->
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-spi</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-api-maven</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-spi-maven</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
Expand All @@ -180,11 +210,15 @@
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</exclusion>
<exclusion>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.descriptors</groupId>
<artifactId>shrinkwrap-descriptors-impl-javaee</artifactId>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven-archive</artifactId>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public ProtocolMetaData deploy(final Archive<?> archive) throws DeploymentExcept
WebAppContext webAppContext = getWebAppContext(app);

if (containerConfig.areMimeTypesSet()) {
containerConfig.getMimeTypes().forEach((s, s2) -> webAppContext.getMimeTypes().addInferred(s, s2));
containerConfig.getMimeTypes().forEach((s, s2) -> webAppContext.getMimeTypes().addMimeMapping(s, s2));
}

deployer.addApp(app);
Expand All @@ -260,7 +260,10 @@ public ProtocolMetaData deploy(final Archive<?> archive) throws DeploymentExcept
HTTPContext httpContext = new HTTPContext(listeningHost, listeningPort);
ServletHandler servletHandler = webAppContext.getServletHandler();
for (ServletHolder servlet : servletHandler.getServlets()) {
httpContext.add(new Servlet(servlet.getName(), servlet.getServletContext().getContextPath()));
if(servlet.getServletContext() != null) {
httpContext.add(new Servlet(servlet.getName(), servlet.getServletContext().getContextPath()));
}

}
return new ProtocolMetaData().addContext(httpContext);
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ public void shouldBeEncodingDefined() throws Exception {
String body = JettyEmbeddedClientTestCase.readAllAndClose(new URL(encodingUrl, MyEncodingServlet.URL_PATTERN).openStream());

assertThat(
"Should contains iso-8859-1",
"Should contains ISO-8859-1",
body,
StringContains.containsString("iso-8859-1"));
StringContains.containsStringIgnoringCase("ISO-8859-1"));
}
}
Loading

0 comments on commit 9367a2c

Please sign in to comment.