I’ve Sonar version 6.0 and there following command scans perfectly -
/home/oracle/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/Sonar6/bin/sonar-scanner -e -Dsonar.web.javaOpts=-Xmx2G -Dsonar.host.url=http://ip-address:9000/ -Dsonar.projectKey=BI7_9 -Dsonar.projectName=BI7_9 -Dsonar.analysis.mode=publish -Dsonar.issuesReport.html.enable=true -Dsonar.issuesReport.console.enable=true -Dsonar.projectBaseDir=/home/oracle/jenkins/workspace/RedmineAndReviewboardProject/SVNCheckout@8/branch_dev
Now I’ve another Sonar server with version 7.6 and if same above is executed by changing ip of new sonar server, it fails with following -
ERROR: Error during SonarQube Scanner execution
File <path>.java can't be indexed twice. Please check that inclusion/exclusion patterns
produce disjoint sets for main and test files
Please guide me what settings I need to do on latest sonar server in order it to work.
By the time you get to SonarQube version 7.6 - which is still past EOL; you should upgrade to 7.9.3 (LTS) or 8.2 (8.3 imminent) at your earliest convenience - a few things have changed. Let’s break down your analysis command:
Not sure what this is supposed to do, so I’ll skip it
This is a server-side option. Won’t do you any good here.
These have all gone away. You can simply drop them
This is most likely your problem. By default the analysis base directory will be the directory from which analysis is executed. No need to re-specify it from root. Simply
cd into the project directory and fire off analysis. If after doing that you still get this error, then we’ll probably need to know more about the structure of your project.