Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-68694] Winstone 6.1: Upgrade Jetty from 9.4.46.v20220331 to 10.0.11 #6801

Merged
merged 11 commits into from
Aug 2, 2022
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ updates:
# Provided by Jetty and should be aligned with the version provided by the
# version of Jetty we deliver. See:
# https://github.com/jenkinsci/jenkins/pull/5211
- dependency-name: "jakarta.servlet:jakarta.servlet-api"
- dependency-name: "javax.servlet:javax.servlet-api"

# Jetty Maven Plugin and Winstone should be upgraded in lockstep in order
Expand Down
3 changes: 3 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ THE SOFTWARE.
<properties>
<asm.version>9.3</asm.version>
<slf4jVersion>1.7.36</slf4jVersion>
<stapler.version>1685.v3b_5035c4ce05</stapler.version>
<stapler.version>1711.v5b_1b_03f0fcf2</stapler.version>
<groovy.version>2.4.21</groovy.version>
</properties>

Expand Down
6 changes: 3 additions & 3 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,9 @@ THE SOFTWARE.
<version>1.1.4c</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>4.0.4</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ THE SOFTWARE.
<module>bom</module>
<module>websocket/spi</module>
<module>websocket/jetty9</module>
<module>websocket/jetty10</module>
<module>core</module>
<module>war</module>
<module>test</module>
Expand Down
1 change: 1 addition & 0 deletions src/spotbugs/spotbugs-excludes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,7 @@
<Class name="jenkins.slaves.StandardOutputSwapper$ChannelSwapper"/>
<Class name="jenkins.util.ProgressiveRendering"/>
<Class name="jenkins.websocket.Jetty9Provider"/>
<Class name="jenkins.websocket.Jetty10Provider"/>
<Class name="jenkins.websocket.Provider"/>
<Class name="jenkins.websocket.WebSockets"/>
<Class name="jenkins.websocket.WebSocketSession"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void pathInfo() throws Exception {
assertThat("error message using " + path, x.getResponse().getContentAsString(), containsString("No valid crumb was included in the request"));
break;
case 400: // from Jetty
assertThat("error message using " + path, x.getResponse().getContentAsString(), containsString("Ambiguous path parameter"));
assertThat("error message using " + path, x.getResponse().getContentAsString(), containsString("path parameter"));
break;
default:
fail("unexpected error code");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void denySemicolonInRequestPathByDefault() throws Exception {
assertThat(Foo.getInstance().baz, is(nullValue()));
assertThat(response.getStatusCode(), is(HttpServletResponse.SC_BAD_REQUEST));
// Actually served by Jetty; never even gets as far as SuspiciousRequestFilter.
assertThat(response.getContentAsString(), containsString("Ambiguous path parameter"));
assertThat(response.getContentAsString(), containsString("path parameter"));
}

@Ignore("No longer passes Jetty")
Expand Down
81 changes: 32 additions & 49 deletions war/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ THE SOFTWARE.
jars that are not needed in war. most of the exclusions should happen in the core, to make IDEs happy, not here.
-->
<exclusion>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<groupId>jakarta.servlet.jsp</groupId>
<artifactId>jakarta.servlet.jsp-api</artifactId>
</exclusion>
<!-- Stapler 1.195 fails to declare this as optional, and the 1.1 version lacks a license: -->
<exclusion>
Expand All @@ -101,6 +101,11 @@ THE SOFTWARE.
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>websocket-jetty10</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>websocket-jetty9</artifactId>
Expand Down Expand Up @@ -142,7 +147,7 @@ THE SOFTWARE.
<groupId>org.jenkins-ci</groupId>
<artifactId>winstone</artifactId>
<!-- Make sure to keep jetty-maven-plugin elsewhere in this file in sync with the Jetty release in Winstone -->
<version>5.25</version>
<version>6.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -169,11 +174,16 @@ THE SOFTWARE.
<enforceBytecodeVersion>
<maxJdkVersion>1.8</maxJdkVersion>
<excludes>
<exclude>org.jenkins-ci:commons-jelly</exclude>
<exclude>org.jenkins-ci.main:cli</exclude>
<exclude>org.jenkins-ci.main:jenkins-core</exclude>
<exclude>org.jenkins-ci.main:remoting</exclude>
<exclude>org.jenkins-ci.main:websocket-jetty9</exclude>
<exclude>org.jenkins-ci.main:websocket-jetty10</exclude>
<exclude>org.jenkins-ci.main:websocket-spi</exclude>
<exclude>org.kohsuke.stapler:stapler</exclude>
<exclude>org.kohsuke.stapler:stapler-groovy</exclude>
<exclude>org.kohsuke.stapler:stapler-jelly</exclude>
</excludes>
</enforceBytecodeVersion>
</rules>
Expand Down Expand Up @@ -560,7 +570,7 @@ THE SOFTWARE.
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.4.46.v20220331</version>
<version>10.0.11</version>
<configuration>
<!--
Reload webapp when you hit ENTER. (See JETTY-282 for more)
Expand All @@ -577,54 +587,27 @@ THE SOFTWARE.
</loginService>
</loginServices>
<systemProperties>
<systemProperty>
<name>JENKINS_HOME</name>
<value>${JENKINS_HOME}</value>
</systemProperty>
<systemProperty>
<!-- always reload views during debugging -->
<name>stapler.jelly.noCache</name>
<value>true</value>
</systemProperty>
<systemProperty>
<!-- show the stapler evaluation during execution -->
<name>stapler.trace</name>
<value>true</value>
</systemProperty>
<systemProperty>
<!-- show the full stack trace on errors (the oops page) -->
<name>jenkins.model.Jenkins.SHOW_STACK_TRACE</name>
<value>true</value>
</systemProperty>
<systemProperty>
<!-- always reload scripts during debugging -->
<name>hudson.script.noCache</name>
<value>true</value>
</systemProperty>
<systemProperty>
<!-- load view resources from the source directly, again for real time change -->
<name>stapler.resourcePath</name>
<value>../core/src/main/resources;</value>
</systemProperty>
<systemProperty>
<!-- enable the plugins in main by default -->
<name>hudson.bundled.plugins</name>
<!-- run "mvn install" once will generate the.hpl -->
<value>${project.build.directory}/${project.build.finalName}/WEB-INF/plugins/*.hpi</value>
</systemProperty>
<systemProperty>
<!-- stat collection pointless -->
<name>hudson.model.UsageStatistics.disabled</name>
<value>true</value>
</systemProperty>
<systemProperty>
<name>hudson.Main.development</name>
<value>true</value>
</systemProperty>
<JENKINS_HOME>${JENKINS_HOME}</JENKINS_HOME>
<!-- always reload views during debugging -->
<stapler.jelly.noCache>true</stapler.jelly.noCache>
<!-- show the stapler evaluation during execution -->
<stapler.trace>true</stapler.trace>
<!-- show the full stack trace on errors (the oops page) -->
<jenkins.model.Jenkins.SHOW_STACK_TRACE>true</jenkins.model.Jenkins.SHOW_STACK_TRACE>
<!-- always reload scripts during debugging -->
<hudson.script.noCache>true</hudson.script.noCache>
<!-- load view resources from the source directly, again for real time change -->
<stapler.resourcePath>../core/src/main/resources;</stapler.resourcePath>
<!-- enable the plugins in main by default -->
<!-- run "mvn install" once will generate the.hpl -->
<hudson.bundled.plugins>${project.build.directory}/${project.build.finalName}/WEB-INF/plugins/*.hpi</hudson.bundled.plugins>
<!-- stat collection pointless -->
<hudson.model.UsageStatistics.disabled>true</hudson.model.UsageStatistics.disabled>
<hudson.Main.development>true</hudson.Main.development>
</systemProperties>
<webApp>
<!-- Allows resources to be reloaded, and enable nicer console logging. -->
<extraClasspath>${project.basedir}/../core/src/main/resources,${project.basedir}/../core/target/classes,${project.build.directory}/support-log-formatter.jar</extraClasspath>
<!-- TODO eclipse/jetty.project#7970 <extraClasspath>${project.basedir}/../core/src/main/resources,${project.basedir}/../core/target/classes,${project.build.directory}/support-log-formatter.jar</extraClasspath> -->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a workaround to this? i.e. without this we can't live reload resources from what I understand.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe there is, but the pain should be short-lived as this has already been fixed upstream and should be present in the next release of Jetty.

<contextPath>${contextPath}</contextPath>
<configurationDiscovered>false</configurationDiscovered>
<!-- see https://wiki.eclipse.org/Jetty/Howto/Avoid_slow_deployment -->
Expand Down
84 changes: 84 additions & 0 deletions websocket/jetty10/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
The MIT License

Copyright (c) 2019, CloudBees, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-parent</artifactId>
<version>${revision}${changelist}</version>
<relativePath>../..</relativePath>
</parent>

<artifactId>websocket-jetty10</artifactId>
<name>Jetty 10 implementation for WebSocket</name>
<description>An implementation of the WebSocket handler that works with Jetty 10.</description>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-bom</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.jenkins-ci</groupId>
<artifactId>winstone</artifactId>
<version>6.1</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>websocket-spi</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.kohsuke</groupId>
<artifactId>access-modifier-annotation</artifactId>
</dependency>
<dependency>
<groupId>org.kohsuke.metainf-services</groupId>
<artifactId>metainf-services</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>
Loading