Skip to content

build(ci): test once on JDK 17 in Jenkins, reserve Jetty ports for the showcase ITs - #1967

Merged
lukaszlenart merged 1 commit into
mainfrom
build/jenkins-single-jdk
Sep 19, 2026
Merged

lukaszlenart merged 1 commit into
mainfrom
build/jenkins-single-jdk

Conversation

@lukaszlenart

Copy link
Copy Markdown
Member

What

Jenkinsfile — one ubuntu agent, JDK 17, four stages:

Stage Command When
Clean up + Detect changes unchanged always
Test verify -DskipAssembly code changed
Deploy Snapshot deploy -DskipTests -DskipITs -DskipAssembly main
Upload nightlies package -DskipTests -DskipITs -pl assembly main

Removed: the JDK 21 stage, -Pcoverage, the separate install -DskipTests, the "Build Source & JavaDoc" stage and the second agent acquisition. Compiles on main go from 5 → 2 (+ the assembly module), full test runs from 2 → 1; a PR build is a single verify. Emails, junit publishing, cleanWs, timeout and polling are unchanged.

apps/showcase/pom.xmlbuild-helper-maven-plugin:reserve-network-port gives the Jetty start/stop executions a free port pair instead of the fixed 8090/8999; failsafe's http.port follows. The plugin-level 8090/8999 stay, so an interactive mvn jetty:run is unchanged. The stop goal that ran before start is gone.

Why

  • GitHub Actions (maven.yml) already runs JDK 17, 21, 25 and the Jakarta EE 11 profile; Sonar consumes the JaCoCo data there. Every Jenkins test run was a subset of that, and -Pcoverage on Jenkins had no consumer. What Jenkins uniquely does is the snapshot deploy and the nightlies upload.
  • disableConcurrentBuilds() only serialises builds of the same branch job. main and a PR landing on one agent both bound 8090, and the pre-start stop goal with the shared stop key could shut down the neighbouring build's Jetty mid-test.
  • failsafe 3.6.0 has no skipTests parameter (only skip / skipITs), so every -DskipTests invocation was still booting Jetty and running the 60 showcase ITs. Hence -DskipITs on the deploy and nightlies lines.
  • The old "Build Source & JavaDoc" stage ran in its own Maven session, so nothing it built was attached to the deploy — the snapshot repository holds only .jar + .pom today. Dropping it publishes exactly what was published before. If sources/javadoc in snapshots are wanted, the line is source:jar javadoc:jar deploy (goals before the phase, so they attach) at the cost of javadoc time on every main build.
  • deploy installs every module, so the nightlies step only needs the assembly module; its descriptors read the sibling target/ and src/ directories of the same workspace.

The port properties are deliberately not declared under <properties>: a declared property is interpolated into plugin configuration at model-build time, before build-helper runs, so the default wins everywhere. Only the executions reference the reserved names.

Verified

  • mvn -pl apps/showcase verify with 8090 and 8999 both held by nc -l: Jetty on a reserved port, 60/60 ITs green, clean stop on the reserved stop port.
  • Two showcase verify runs at once from two worktrees: distinct ports, both green, each stopping its own Jetty.
  • mvn package -DskipTests -DskipITs -pl assembly offline after an install: all six zips built.
  • The Jenkinsfile's verify path is what this PR's Jenkins build exercises; the deploy/nightlies path only runs after merge to main — watch the first main build.

Out of scope, noted for later: apps/rest-showcase has IT classes but no failsafe execution, so they never run; and the support/struts-6-x-x Jenkinsfile is separate (JDK 8) and untouched.

🤖 Generated with Claude Code

…e showcase ITs

Jenkins ran the suite on JDK 21 and again on JDK 17 with -Pcoverage,
then re-compiled the tree three more times for install, deploy and the
nightlies. GitHub Actions already covers JDK 17, 21, 25 and the Jakarta
EE 11 profile, and the JaCoCo data had no consumer on Jenkins. Jenkins
now runs one verify on JDK 17 and keeps only what GitHub cannot do: the
snapshot deploy and the nightlies upload. The deploy also passes
-DskipITs: failsafe 3.6.0 has no skipTests parameter, so the showcase
integration tests were booting Jetty on every "skipped" invocation. The
nightlies step builds only the assembly module; the preceding deploy has
already installed every other module and the descriptors read the
sibling target/ directories of the same workspace.

The old "Build Source & JavaDoc" stage ran in its own Maven session, so
its jars were never attached to the deploy; the snapshot repository has
only the main jar and pom. Dropping it changes nothing that is
published.

The showcase integration tests bound Jetty to a fixed 8090/8999.
disableConcurrentBuilds() serialises only builds of the same branch
job, so main and a pull request landing on one agent collided, and the
pre-start "stop" goal with the shared stop key could shut down the
neighbouring build's server. build-helper now reserves free ports for
the start/stop executions; the plugin-level 8090/8999 stay in place for
an interactive jetty:run. The port properties are deliberately not
declared under <properties>: a declared property is interpolated into
plugin configuration at model-build time, before build-helper runs, and
the default would win everywhere.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@lukaszlenart
lukaszlenart marked this pull request as ready for review September 19, 2026 05:44
@sonarqubecloud

Copy link
Copy Markdown

@lukaszlenart
lukaszlenart merged commit e5fb8e9 into main Sep 19, 2026
16 checks passed
@lukaszlenart
lukaszlenart deleted the build/jenkins-single-jdk branch September 19, 2026 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant