Failure with using License Finder on Gitlab CI

Viewed 563

I am trying to run add a stage in my Gitlab CI to generate a license report. As mentioned on the Gitlab CI guidelines the job can be easily done by including a stage like this in the .gitlab-ci.yml file :

license_management:
  stage: analysis
  image:
    name: "registry.gitlab.com/gitlab-org/security-products/license-management:$CI_SERVER_VERSION_MAJOR-$CI_SERVER_VERSION_MINOR-stable"
    entrypoint: [""]
  allow_failure: true
  variables:
    MAVEN_CLI_OPTS: --debug -DskipTests
  script:
    - /run.sh analyze .
  artifacts:
    reports:
      license_management: gl-license-management-report.json
  dependencies: []
  except:
    variables:
      - $LICENSE_MANAGEMENT_DISABLED

The expected is to get the file with name : gl-license-management-report.json

But instead i get an exception while generation of the file as follows:

Running license_finder  in /builds/root/scs-boilerplate-app/java-spring-boot
LicenseFinder::Maven: is active
/usr/local/rvm/gems/ruby-2.5.1/gems/license_finder-5.6.2/lib/license_finder/package_managers/maven.rb:20:in `current_packages': Command './mvnw org.codehaus.mojo:license-maven-plugin:download-licenses' failed to execute: Exception in thread "main" java.lang.RuntimeException: Could not load wrapper properties from '/builds/root/scs-boilerplate-app/java-spring-boot/.mvn/wrapper/maven-wrapper.properties'. (RuntimeError)
    at org.apache.maven.wrapper.WrapperExecutor.<init>(WrapperExecutor.java:72)
    at org.apache.maven.wrapper.WrapperExecutor.forWrapperPropertiesFile(WrapperExecutor.java:56)
    at org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:54)
Caused by: java.lang.RuntimeException: No value with key 'distributionUrl' specified in wrapper properties file '/builds/root/scs-boilerplate-app/java-spring-boot/.mvn/wrapper/maven-wrapper.properties'.
    at org.apache.maven.wrapper.WrapperExecutor.reportMissingProperty(WrapperExecutor.java:141)
    at org.apache.maven.wrapper.WrapperExecutor.readDistroUrl(WrapperExecutor.java:92)
    at org.apache.maven.wrapper.WrapperExecutor.prepareDistributionUri(WrapperExecutor.java:78)
    at org.apache.maven.wrapper.WrapperExecutor.<init>(WrapperExecutor.java:66)
    ... 2 more
0 Answers
Related