License_scanning failing for SBT
Summary
When running the license scan on Scala projects, it fails with a "java not found" error message
Steps to reproduce
- Have a Scala project
- Add license scanning in gitlab-ci Eg:
include:
- template: "Security/License-Scanning.gitlab-ci.yml"
steps:
- test
...
- Follow SBT instructions for license scanner here: https://github.com/pivotal/LicenseFinder#sbt-projects
- Push and trigger a CI run
What is the current bug behavior?
Here is some partial output for our licence_scanning step:
$ /run.sh analyze .
Selecting previously unselected package asdf.
(Reading database ... 18412 files and directories currently installed.)
Preparing to unpack .../asdf_0.7.8-1_amd64.deb ...
Unpacking asdf (0.7.8-1) ...
Setting up asdf (0.7.8-1) ...
Prepare
00:03
Added development to the ignored groups
Added develop to the ignored groups
Added test to the ignored groups
license_management report --prepare-no-fail --format=json --save=gl-license-scanning-report.json --no-recursive --no-debug
LicenseFinder::Sbt: is active
[v3.25.7] copying runtime jar...
[v3.25.7] /opt/asdf/installs/sbt/1.3.8/bin/sbt: line 336: java: command not found
mkdir: cannot create directory ‘’: No such file or directory
/opt/asdf/installs/sbt/1.3.8/bin/sbt: line 343: java: command not found
/opt/asdf/installs/sbt/1.3.8/bin/sbt: line 127: exec: java: not found
[v3.25.7] Command 'sbt dumpLicenseReport' failed to execute: /opt/asdf/installs/sbt/1.3.8/bin/sbt: line 336: java: command not found
mkdir: cannot create directory ‘’: No such file or directory
/opt/asdf/installs/sbt/1.3.8/bin/sbt: line 343: java: command not found
/opt/asdf/installs/sbt/1.3.8/bin/sbt: line 127: exec: java: not found
The scan then succeeds and informs GitLab.com that there are 0 licenses for the project.
What is the expected correct behavior?
We actually get a scan and a list of licenses.
Relevant logs and/or screenshots
(posted above)
Output of checks
This is happening on gitlab.com