Our project is a multi module plugin project built using maven. The Sonar analysis runs fine but in the process generates a lot of warnings and probably incorrect results. Below is the set up of the project and warnings generated during analysis. Any help in fixing these warnings is highly appreciated.
Project setup:
- Sonar analysis via the jenkins build.
- Jenkins Sonar plugin is used to run the analysis.
- Jenkins and Sonar along with MySQL are running on different machines.
Below properties are provided to Sonar plugin in Jenkins during sonar analysis.
-Dsonar.profile="My Project Profile" -Dsonar.dynamicAnalysis=reuseReports -Dsonar.core.codeCoveragePlugin=jacoco -Dsonar.jacoco.reportPath=../../releng/com.mycompany.myproject.releng.builds/coverage_data/jacoco.exec
Below are the warnings generated during analysis:
Note: The below warnings are not generated if Sonar and Jenkins are running in the same machine
- Before the Sonar analysis of individual modules the following error is thrown.
[WARNING] The following dependencies could not be resolved at this point of the build but seem to be part of the reactor: 15:04:52 [WARNING] o com.mycompany.myproject.plugins:com.mycompany.myproject.external.libraries:jar:1.0.0-SNAPSHOT (provided) 15:04:52 [WARNING] Try running the build up to the lifecycle phase "package" 15:04:52 [WARNING] The following dependencies could not be resolved at this point of the build but seem to be part of the reactor: 15:04:52 [WARNING] o com.mycompany.myproject.plugins:com.mycompany.myproject.somefunctionality.framework:jar:1.0.0-SNAPSHOT (provided)
- During the analysis of the modules, it throws the following warning
Class 'com/mycompany/myproject/core/common/datatransfers/MyClass' is not accessible through the ClassLoader. [WARN] [15:05:25.731] Class 'com/mycompany/myproject/core/common/datatransfers/MyClass' is not accessible through the ClassLoader.
- Almost all modules are marked as skipped after the analysis after the build is complete, However the analysis results are available in Sonar.
[INFO] com.mycompany.myproject.platform.feature ................ SKIPPED [INFO] com.mycompany.myproject.somefeature.feature ... SKIPPED [INFO] My Product ............................... SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS