Skip to content

Commit

Permalink
[JENKINS-73419] Migrate HPI plugin from EE 8 to EE 9 (#652)
Browse files Browse the repository at this point in the history
  • Loading branch information
basil authored Sep 4, 2024
1 parent a26601d commit b4fc937
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 20 deletions.
35 changes: 23 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.ee8</groupId>
<artifactId>jetty-ee8-bom</artifactId>
<groupId>org.eclipse.jetty.ee9</groupId>
<artifactId>jetty-ee9-bom</artifactId>
<version>${jetty.version}</version>
<type>pom</type>
<scope>import</scope>
Expand Down Expand Up @@ -170,13 +170,24 @@
<artifactId>plexus-utils</artifactId>
<version>3.5.1</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven</artifactId>
<version>${jetty.version}</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.ee8</groupId>
<artifactId>jetty-ee8-maven-plugin</artifactId>
<groupId>org.eclipse.jetty.ee9</groupId>
<artifactId>jetty-ee9-maven-plugin</artifactId>
<version>${jetty.version}</version>
<exclusions>
<exclusion>
Expand All @@ -186,17 +197,17 @@
</exclusions>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.ee8</groupId>
<artifactId>jetty-ee8-servlet</artifactId>
<groupId>org.eclipse.jetty.ee9</groupId>
<artifactId>jetty-ee9-servlet</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.ee8</groupId>
<artifactId>jetty-ee8-webapp</artifactId>
<groupId>org.eclipse.jetty.ee9</groupId>
<artifactId>jetty-ee9-webapp</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.ee8.websocket</groupId>
<artifactId>jetty-ee8-websocket-jetty-server</artifactId>
<!-- or jetty-ee8-websocket-javax-server -->
<groupId>org.eclipse.jetty.ee9.websocket</groupId>
<artifactId>jetty-ee9-websocket-jetty-server</artifactId>
<!-- or jetty-ee9-websocket-jakarta-server -->
</dependency>
<dependency>
<groupId>org.jenkins-ci</groupId>
Expand Down Expand Up @@ -319,7 +330,7 @@
<configuration>
<goalPrefix>hpi</goalPrefix>
<extractors>java-annotations</extractors>
<mojoDependencies>org.eclipse.jetty.ee8:jetty-ee8-maven-plugin</mojoDependencies>
<mojoDependencies>org.eclipse.jetty.ee9:jetty-ee9-maven-plugin</mojoDependencies>
</configuration>
<executions>
<execution>
Expand Down
14 changes: 13 additions & 1 deletion src/it/parent-4x/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,23 @@
<version>1.0-SNAPSHOT</version>
<packaging>hpi</packaging>
<properties>
<jenkins.version>2.361.4</jenkins.version>
<jenkins.version>2.475</jenkins.version>
<!-- TODO JENKINS-73339 until in parent POM -->
<jenkins-test-harness.version>2254.vcff7a_d4969e5</jenkins-test-harness.version>
<hpi-plugin.version>@project.version@</hpi-plugin.version>
<no-test-jar>false</no-test-jar>
<spotless.check.skip>false</spotless.check.skip>
</properties>
<dependencyManagement>
<dependencies>
<!-- TODO JENKINS-73339 until in parent POM, work around https://github.com/jenkinsci/plugin-pom/issues/936 -->
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>5.0.0</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
Expand Down
3 changes: 2 additions & 1 deletion src/it/parent-4x/src/main/java/test/JustTesting.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.concurrent.TimeUnit;
import jenkins.model.Jenkins;
import jenkins.util.Timer;
import org.kohsuke.stapler.StaplerRequest2;

public class JustTesting {

Expand All @@ -18,7 +19,7 @@ public static void shutDown() {
Timer.get()
.schedule(
() -> {
Jenkins.getInstance().doSafeExit(null);
Jenkins.getInstance().doSafeExit((StaplerRequest2) null);
return null;
},
15,
Expand Down
2 changes: 1 addition & 1 deletion src/it/parent-4x/verify.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ checkArtifact(installed, 'parent-4x-1.0-SNAPSHOT.hpi',
['WEB-INF/lib/parent-4x.jar'],
// TODO still some problems with unwanted transitive JAR dependencies creeping in, e.g. WEB-INF/lib/jboss-marshalling-1.4.9.Final.jar in workflow-multibranch.hpi, or all kinds of junk in parameterized-trigger.hpi
['test/SampleRootAction.class', 'WEB-INF/lib/symbol-annotation-1.5.jar'],
['Short-Name': 'parent-4x', 'Group-Id': 'org.jenkins-ci.tools.hpi.its', 'Jenkins-Version': '2.361.4' /* Plugin-Version unpredictable for a snapshot */, 'Plugin-Dependencies': 'structs:324.va_f5d6774f3a_d'])
['Short-Name': 'parent-4x', 'Group-Id': 'org.jenkins-ci.tools.hpi.its', 'Jenkins-Version': '2.475' /* Plugin-Version unpredictable for a snapshot */, 'Plugin-Dependencies': 'structs:324.va_f5d6774f3a_d'])

checkArtifact(installed, 'parent-4x-1.0-SNAPSHOT.jar',
['META-INF/annotations/hudson.Extension', 'test/SampleRootAction.class', 'index.jelly'],
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/jenkinsci/maven/plugins/hpi/RunMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.graph.DependencyFilter;
import org.eclipse.aether.util.filter.ScopeDependencyFilter;
import org.eclipse.jetty.ee8.maven.plugin.JettyRunWarMojo;
import org.eclipse.jetty.ee8.maven.plugin.MavenWebAppContext;
import org.eclipse.jetty.ee8.webapp.WebAppClassLoader;
import org.eclipse.jetty.ee8.webapp.WebAppContext;
import org.eclipse.jetty.ee8.websocket.server.config.JettyWebSocketServletContainerInitializer;
import org.eclipse.jetty.ee9.maven.plugin.JettyRunWarMojo;
import org.eclipse.jetty.ee9.maven.plugin.MavenWebAppContext;
import org.eclipse.jetty.ee9.webapp.WebAppClassLoader;
import org.eclipse.jetty.ee9.webapp.WebAppContext;
import org.eclipse.jetty.ee9.websocket.server.config.JettyWebSocketServletContainerInitializer;
import org.eclipse.jetty.http.HttpCompliance;
import org.eclipse.jetty.http.UriCompliance;
import org.eclipse.jetty.maven.MavenServerConnector;
Expand Down

0 comments on commit b4fc937

Please sign in to comment.