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:
-e
Not sure what this is supposed to do, so I’ll skip it
-Dsonar.web.javaOpts=-Xmx2G
This is a server-side option. Won’t do you any good here.
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.