javaspring-bootintellij-ideaautowired

Controller classes show as unused when its used


I have a Spring Boot Web API application in IntelliJ. Project compiles and APIs are working correctly. It's setup with @Autowired, @Controller, @Service, @Repository, etc.

However, it keeps showing the classes as grey (unused). How can I show it to be used? Or is the way it's in default, and no way to remove this warning error? It's doing this similarly for services and repository classes.

enter image description here

Note:

How can I fix or turn off the warning? I had something similar at my last company, but they got rid of it. Trying to fix it on my local desktop computer.


Solution

  • In the same project, a class is called used when it is referenced by another class or variable. If you access this class through the browser interface, the IDE will not think that this class is “used”.