Find Spring annotation-shape smells

Proprietary

Stereotype/injection annotations applied to the wrong Kotlin shape: @Component on data class, @Service on object, @Bean without @Scope, @Autowired on var / lateinit var / class-body val, and @Lazy @Autowired (a hint of circular dependencies).

org.openrewrite.kotlin.spring.FindSpringAnnotationSmells$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.spring.FindSpringAnnotationSmells$KtRecipe'

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Find @Component / @Service / @Repository on data class
  2. Find @Service object Foo declarations
  3. Find @Bean methods without @Scope
  4. Find @Autowired var properties (not lateinit)
  5. Find @Autowired lateinit var properties (ctor-injection candidate)
  6. Find @Autowired val field declarations (not in ctor)
  7. Find @Lazy annotations on @Autowired properties