Must-share information (formatted with Markdown):
- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
- how is SonarQube deployed: zip, Docker, Helm
- what are you trying to achieve
When scanning Java projects, one of the rules is “Remove this call to “equals”; comparisons between unrelated types always return false”,But the code in my actual project is as follows:
In actual business scenarios, the obtained id will not be null, so you can use the equals method for comparison.
- what have you tried so far to achieve this
Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!
Your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:
8.9.0 → 9.9.3 → 10.3 (last step optional)
You may find these resources helpful:
If you have questions about upgrading, feel free to open a new thread for that here.
If your issue persists after upgrade, please come back to us.
There is no wrapper.conf file in the conf folder in version 9.9. How to specify the wrapper.java.command path?
Thank you very much for your answer. I have successfully upgraded to version 9.9, but the minimum version of JDK required by 9.9 is 11, and my project is built using JDK1.8
How to solve the problem of inconsistent JDK versions between sonarQube local scan and Maven project build?
In addition, why does the command executed by the local scan of sonarQube9.9 version maven project is mvn clean verify?
I think the documentation on Scanner Environment should help you.
If your whole Maven or Gradle build doesn’t run on Java 11 or 17, we suggest first to try to base the whole build on one of those two versions of Java. If it’s not compatible, then you can override the
JAVA_HOME environment variable just before the analysis step, as shown here:
# Maven build
mvn verify ...
mvn sonar:sonar ...