Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not execute Findbugs #1042

Open
Mos26 opened this issue Oct 30, 2024 · 5 comments
Open

Can not execute Findbugs #1042

Mos26 opened this issue Oct 30, 2024 · 5 comments

Comments

@Mos26
Copy link

Mos26 commented Oct 30, 2024

Hi
We faced an issue when we installed Findbugs, Could you please help us to resolved the issue?

| ------------------ | ------- |
| SonarQube | 10.6 |
| Sonar-FindBugs | 4.2.10 |
| Java |17|

Error:

15:14:56.688 ERROR: Error during SonarScanner execution
15:14:56.687 INFO: Final Memory: 53M/180M
15:14:56.688 INFO: ------------------------------------------------------------------------
java.lang.IllegalStateException: Can not execute Findbugs
at org.sonar.plugins.findbugs.FindbugsExecutor.execute(FindbugsExecutor.java:191)
at org.sonar.plugins.findbugs.FindbugsSensor.execute(FindbugsSensor.java:132)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88)

@gtoison
Copy link
Contributor

gtoison commented Oct 30, 2024

Can you please share more of the logs? There should be more details before and after this error

@Mos26
Copy link
Author

Mos26 commented Oct 30, 2024

Hi @gtoison
Please find the attachment.
logs_636556.zip

@gtoison
Copy link
Contributor

gtoison commented Oct 30, 2024

The relevant error message is:

2024-10-29T15:14:56.7133072Z Caused by: java.lang.IllegalStateException: One (sub)project contains Java source files that are not compiled (D:\a\1\s).
2024-10-29T15:14:56.7133566Z Project has java source file(s), they must be compiled to be analyzed.
2024-10-29T15:14:56.7134033Z Property sonar.java.binaries was not set, it is required to locate the compiled .class files. For instance set the property to: sonar.java.binaries=target/classes
2024-10-29T15:14:56.7134614Z Sonar JavaResourceLocator.classpath was empty
2024-10-29T15:14:56.7135085Z Sonar JavaResourceLocator.classFilesToAnalyze was empty
2024-10-29T15:14:56.7135565Z 	at org.sonar.plugins.findbugs.FindbugsConfiguration.buildMissingCompiledCodeException(FindbugsConfiguration.java:175)
2024-10-29T15:14:56.7136109Z 	at org.sonar.plugins.findbugs.FindbugsConfiguration.initializeFindbugsProject(FindbugsConfiguration.java:139)
2024-10-29T15:14:56.7136625Z 	at org.sonar.plugins.findbugs.FindbugsConfiguration.initializeFindbugsProject(FindbugsConfiguration.java:102)
2024-10-29T15:14:56.7137117Z 	at org.sonar.plugins.findbugs.FindbugsExecutor.execute(FindbugsExecutor.java:117)
2024-10-29T15:14:56.7137479Z 	... 34 more

There are sources (java, kotlin, jsp, ...) in a project but the plugin could not find the corresponding .class files
SpotBugs analyses the .class files, not the sources so the project needs to be compiled before analysis

@Mos26
Copy link
Author

Mos26 commented Oct 31, 2024

@gtoison But before installing this plugin we didn't have any issues. Is it possible to ignore it, and if so, how?

@gtoison
Copy link
Contributor

gtoison commented Oct 31, 2024

You can set sonar.findbugs.allowuncompiledcode=true if your code is not compiled, in that case SpotBugs won't analyze it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants