简体   繁体   中英

Sonar using Sonar Runner on Jenkins Job fails to access classes

Im trying to run a sonar analysis on a Jenkins Job. Im using ant so im using Sonar Runner and sonar.properties in the projects. Im configuring the the binaries to

sonar.binaries=build/ant/classes

After a successfull build Sonar starts and is running a while. But i get a lot of warnings during bytecode analysis.

Im getting WARN XX - Class 'XX' is not accessible through the ClassLoader.

for every class...

I dont really know why classes are all there?

These are warnings issued by Findbugs, which requires access to source, compile binaries and 3rd party libraries.

To resolve these warnings you need to include an additional sonar.libraries property, populated with the 3rd party jars your code depends upon (See Analaysis Parameters documentation )

I actually had the same problem, but that was because of an issue with the maven caches.

I had run mvn clean install in the directory on my local machine, but was running sonar on the directory on a virtual box. This resulted in classes not being found.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM