Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maven_settings_file parameter relative path logic is not working properly. #65

Closed
cyclump opened this issue Jul 15, 2020 · 0 comments
Closed

Comments

@cyclump
Copy link

cyclump commented Jul 15, 2020

When using the maven_settings_file parameter the code on line 82 checks for the existence of the file relative to the root directory of /tmp/build/put. On lines 290-292 when the maven command is invoked, the code changes to the directly first then evals the command line.

Given this, when using

  - put: code-analysis
    params:
      project_path: sonarqube-analysis-input
      scanner_type: maven
      project_key: my-key
      project_name: my name
      maven_settings_file: sonarqube-analysis-input/maven_settings.xml

maven cannot find the settings file because it is in the project directlory. You get this error:

Preparing SonarQube scanner...
Using Maven settings file: "sonarqube-analysis-input/maven_settings.xml"...
Starting sonar-scanner (type: maven)...
[ERROR] Error executing Maven.
[ERROR] The specified user settings file does not exist: /tmp/build/put/sonarqube-analysis-input/sonarqube-analysis-input/maven_settings.xml
ERROR in /opt/resource/out : line 292 with exit code 1

If you change the settings file by removing the directory, the code on line 82 can't find the file and stops with an error.

  - put: code-analysis
    params:
      project_path: sonarqube-analysis-input
      scanner_type: maven
      project_key: my-key
      project_name: my name
      maven_settings_file: maven_settings.xml

yeilds error: Maven settings file not found: maven_settings.xml.

The only way to make it work is to not use relative paths with requires you to use `/tmp/build/put' on the front of the file. This seems wrong as you are putting concourse specifics details into the YAML definition.

@cyclump cyclump changed the title maven_settings_file parameter not working. maven_settings_file parameter relative path logic is not working properly. Jul 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant