Spotbugs can use Java 8 or Java 11
What does this MR do?
The version of Java that Spotbugs will use can be set using an environment variable SAST_JAVA_VERSION
. Valid values are either 8
, or 11
.
SDKMAN! is used to install both versions of Java, as well as set the system wide default Java. It is necessary to set the Java system wide so that Spotbugs and its dependencies (e.g. Maven) use the same specified Java version. Note that the JAVA_PATH
variable overrides SAST_JAVA_VERSION
, meaning that Spotbugs will run with the Java at the specified path. However, dependencies such as Maven will not use JAVA_PATH
and will instead use the system default.
A bash script is used to setup the system wide Java on run of the docker image. The analyzer will be called once Java has been setup. This means that the entry point to this image is no longer the analyzer, but instead is the run script. I have bumped the major version of the image due to this change.
When no SAST_JAVA_VERSION
environment is used, the system defaults to Java 8.
This closes EE issue 9998.
This is an extension of the work @haynes has done on a separate MR.
What are the relevant issue numbers?
Does this MR meet the acceptance criteria?
-
Changelog entry added -
Documentation created/updated for GitLab EE, if necessary -
Documentation created/updated for this project, if necessary -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Job definition updated, if necessary -
Auto-DevOps template (also in CE) -
Job definition example -
CI Templates (to be removed) -
Vendored CI Templates (also in CE)
-
-
Conforms to the code review guidelines -
Conforms to the Go guidelines -
Security reports checked/validated by reviewer