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

sonar.projectBaseDir ignored #43

Open
ThomasCluzel opened this issue Sep 8, 2020 · 0 comments
Open

sonar.projectBaseDir ignored #43

ThomasCluzel opened this issue Sep 8, 2020 · 0 comments
Labels

Comments

@ThomasCluzel
Copy link

ThomasCluzel commented Sep 8, 2020

Describe the bug

A clear and concise description of what the bug is.

When running sonar-scanner with the option sonar.projectBaseDir, report files are not found.

To reproduce

Steps to reproduce the behavior.

  1. Analyse a C/C++ project with Frama-C and produce output files (**/*.csv and **/*.out)
    • frama-c file.c -rte -metrics -report-csv frama-c.csv > framac-results.out
  2. Write a minimal sonar-project.properties if not already done
    • sonar.projectKey=my-project
      sonar.projectName=My Project
      sonar.projectVersion=1.0
      sonar.sources=src
      
  3. Run sonar-scanner from a different folder with the option sonar.projectBaseDir
    • sonar-scanner -Dsonar.projectBaseDir=/path/to/project
  4. In sonar-scanner output, look for lines similar to
    • WARN: Results file frama-c.csv has not been found and wont be processed.
      WARN: Results file framac-results.out has not been found and wont be processed.
      

This output tells us that result files were found when sonar-scanner looks for files to collect but were not found later when trying to import then.

Expected behavior

A clear and concise description of what you expected to happen.

The result files should be imported correctly. The base directory from which the sensor looks for these files should be sonar.projectBaseDir.

Screenshots & log

If applicable, add screenshots to help explain your problem. Then, append SonarQube log and do not forget to obfuscate them._

INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /usr/src/tests/c_cpp/sonar-project.properties
INFO: SonarScanner 4.4.0.2170
INFO: Java 11.0.8 Debian (64-bit)
INFO: Linux 4.15.0-112-generic amd64
INFO: User cache: /opt/sonar-scanner/.sonar/cache
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /usr/src/tests/c_cpp/sonar-project.properties
INFO: Analyzing on SonarQube server 7.9.4
INFO: Default locale: "en_US", source code encoding: "US-ASCII" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=93ms
INFO: Server id: BF41A1F2-AXRsiTfL4ce7qAj-yTQm
INFO: User cache: /opt/sonar-scanner/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=37ms
INFO: Load/download plugins (done) | time=114ms
WARN: Plugin SonarQube CNES Report [cnesreport] uses a child first classloader which is deprecated
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=2ms
INFO: Project key: framac-dummy-project
INFO: Base dir: /usr/src/tests/c_cpp
INFO: Working dir: /usr/src/tests/c_cpp/.scannerwork
INFO: Load project settings for component key: 'framac-dummy-project'
INFO: Load project settings for component key: 'framac-dummy-project' (done) | time=96ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=49ms
INFO: Load active rules
INFO: Load active rules (done) | time=5404ms
INFO: Indexing files...
INFO: Project configuration:
INFO: 7 files indexed
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for c++: CNES_CPP_A
INFO: ------------- Run sensors on module Frama-C Dummy Project
WARN: Component of type class org.sonar.plugins.findbugs.FindbugsConfiguration defines methods start() and/or stop(). Neither will be invoked to start/stop the component. Please implement either org.picocontainer.Startable or org.sonar.api.Startable
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=63ms
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/opt/sonar-scanner/.sonar/cache/866bb1adbf016ea515620f1aaa15ec53/sonar-javascript-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=1ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=9ms
INFO: Sensor SonarFrama-C [framac]
WARN: Results file .scannerwork/class-mapping.csv has not been found and wont be processed.
WARN: Results file frama-c.csv has not been found and wont be processed.
WARN: Results file framac-results.out has not been found and wont be processed.
WARN: No results file found for Frama-C.
INFO: Sensor SonarFrama-C [framac] (done) | time=9ms
INFO: Sensor C++ (Community) SquidSensor [cxx]
INFO: Load project repositories
INFO: Load project repositories (done) | time=12ms
WARN: Metric 'comment_lines_data' is deprecated. Provided value is ignored.
INFO: Sensor C++ (Community) SquidSensor [cxx] (done) | time=556ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=3ms
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=12ms
INFO: SCM provider for this project is: git
INFO: 7 files to be analyzed
INFO: 7/7 files analyzed
INFO: 6 files had no CPD blocks
INFO: Calculating CPD for 1 file
INFO: CPD calculation finished
INFO: Analysis report generated in 57ms, dir size=164 KB
INFO: Analysis report compressed in 26ms, zip size=35 KB
INFO: Analysis report uploaded in 72ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://lequalsonarqube:9000/dashboard?id=framac-dummy-project
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at http://lequalsonarqube:9000/api/ce/task?id=AXRskApY4ce7qAj-yajg
INFO: Executing post-job 'Final report'
INFO: Turn debug info on to get more details (sonar-scanner -X -Dsonar.verbose=true ...).
INFO: Analysis total time: 8.254 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 9.094s
INFO: Final Memory: 14M/57M
INFO: ------------------------------------------------------------------------

User environment

Please complete the following information.

  • OS: Debian 10.5
  • Java version: 11.0.8
  • SonarQube version: 7.9.4
  • Plugin version: 2.1.1

Additional context

Add any other context about the problem here.

Good starting point

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant