I am using
- SonarQube Enterprise Edition Version 9.2.4 (build 50792)
- Scanner:
- SonarLint for IntelliJ 6.7.0.45926
- sonar-maven-plugin:3.9.1.2184
I have a Spring Boot application and the scanner produces the warning “Spring beans should be considered by “@ComponentScan”” for the following class:
package com.company.a.b.c.impl;
@Service
public class MyService {...}
Then the Application class:
package com.company.a
@SpringBootApplication
public class MyApplication {...}
I am aware of this answer False positive for Spring java:S4605 for multi-module projects. "component is not visible by @ComponentScan"
and since my project is a multi-module project, I also tried adding an empty @Component
annotation and also a @Component
with different values, once “com.company.a.b”, once “com.company.a.b.c.impl” but SonarLint still displays the warning.
Please note that the application is started as expected.