Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SonarQube : " Project configuration file: NONE "

I've configured everything to do a Sonar analysis on a Maven project. Everything is fine until I run sonar-runner :

     Max$ sonar-runner
     INFO: Scanner configuration file: /Users/Max/Documents/sonar-scanner-2.5/conf/sonar-runner.properties
     INFO: Project configuration file: NONE
     INFO: SonarQube Scanner 2.5
     INFO: Java 1.7.0_45 Oracle Corporation (64-bit)
     INFO: Mac OS X 10.10.3 x86_64
     INFO: User cache: /Users/Max/.sonar/cache
     INFO: Load global repositories
     INFO: Load global repositories (done) | time=143ms
     INFO: Property 'sonar.jdbc.url' is not supported any more. It will be ignored. There is no longer any DB connection to the SQ database.
     INFO: User cache: /Users/Max/.sonar/cache
     INFO: Load plugins index
     INFO: Load plugins index (done) | time=4ms
     INFO: Default locale: "fr_FR", source code encoding: "UTF-8" (analysis  is platform dependent)
     INFO: Process project properties
     INFO: ------------------------------------------------------------------------
     INFO: EXECUTION FAILURE
     INFO: ------------------------------------------------------------------------
     INFO: Total time: 1.631s
     INFO: Final Memory: 40M/194M
     INFO: ------------------------------------------------------------------------
     ERROR: Error during SonarQube Scanner execution
     ERROR: Unable to load component class org.sonar.batch.scan.ProjectLock
     ERROR: Caused by: Unable to load component class     org.sonar.api.batch.bootstrap.ProjectReactor
     ERROR: Caused by: You must define the following mandatory properties for 'Unknown': sonar.projectKey, sonar.projectName, sonar.projectVersion, sonar.sources
     ERROR: 
     ERROR: To see the full stack trace of the errors, re-run SonarQube  Scanner with the -e switch.
     ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
  • I'm running sonar-runner inside my java project folder
  • I have put and configured the sonar-runner.properties in my java project

    sonar.projectKey=SeleniumMaven:sonar
    sonar.projectName=SeleniumMaven
    sonar.projectVersion=1.0
    sonar.sources=src
    sonar.sourceEncoding=UTF-8
    sonar.language=java
    

Any idea?

like image 234
user3568978 Avatar asked Feb 10 '16 11:02

user3568978


2 Answers

Try passing the values like this :

sonar-runner -Dsonar.projectKey=..... -Dsonar.projectName=...

if it works, it means the property file is somewhat ignored

If you look at the following message :

INFO: Scanner configuration file: /Users/Max/Documents/sonar-scanner-2.5/conf/sonar-runner.properties
INFO: Project configuration file: NONE

It seems like your project configuration file is indeed ignored

like image 119
Hello_world Avatar answered Sep 16 '22 14:09

Hello_world


I had the same problem and I realized my file name was incorrect: instead of "sonar-project.properties" I had it as "sonar-project.properties.properties".

I would try and change your file name to "sonar-project.properties" and try ...

like image 44
Pratik Avatar answered Sep 16 '22 14:09

Pratik