Search code examples
spring-mvcintellij-ideacode-inspection

Prevent from Intellij Idea inspection show controller methods as Unused


I have Spring MVC project (gradle, kotlin) and Idea inspection shows me my MVC controller methods as unused. How can I make the inspection tool recognize that those methods are entry points and should not be analyzed for usages?


Solution

  • You can mark the spring mvc annotations such as @PostMapping, @GetMapping etc as entrypoint annotations in the idea inspection profile screenshot