[DO NOT DO] Dependency scanning fails on Java/JDK 13 projects
!!! DO NOT DO - COMPLETE #216082 (closed) and then close this noting #216082 (closed) should allow for this to be worked around
Summary
If a Maven project has a target release for Java/JDK 13, then the job fails to build and produces a [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project demo: Fatal error compiling: error: invalid target release: 13 -> [Help 1] error
Reported in ZD (internal use only)
Steps to reproduce
- Create a new project in GitLab, using the Spring template
- Edit
pom.xmlto include:
<project>
<properties>
<maven.compiler.source>13</maven.compiler.source>
<maven.compiler.target>13</maven.compiler.target>
</properties>
</project>
- Add to
.gitlab-ci.yml:
include:
- template: Dependency-Scanning.gitlab-ci.yml
- Observe the job fail.
Example Project
See https://gitlab.com/anton/depedency-scanning-jdk-13.
What is the current bug behavior?
Dependency scanning fails to work because the project needs to build for Java/JDK 13, but this version isn't available.
What is the expected correct behavior?
Dependency scanning should work, regardless of the release version specified.
Relevant logs and/or screenshots
A pipeline log can be found here https://gitlab.com/anton/depedency-scanning-jdk-13/-/jobs/501140526
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)(we will only investigate if the tests are passing)
Possible fixes
Assuming Sbt 1.0 is compatible w/ Java 14, change the base image of gemnasium-maven to maven:3.6.3-openjdk-14-slim, and upgrade Gradle to v6.3.