Starting with Java 9+, JAXB is not available anymore by default in the JDK.
This Jenkins Docker image demonstrates that the https://github.com/jenkinsci/jaxb-plugin/ allows to fix the ClassNotFoundException
we would normally encounter.
-
Run it on Java 11
docker run -p 8080:8080 -ti batmat/jaxb-java11-demo
-
Open the browser on http://localhost:8080
-
Login as admin:admin
-
Install the sloccount plugin through the plugin manager UI [1]
-
Start the count-loc job
-
See it succeeds, despite running on Java 11 without any java 11 specific flag (i.e. no
--add-modules
)
1. this must be done this way because preinstalling plugins in the Docker image would not install implied dependency, which JAXB is.