Rob Spoor wrote:@Inject is JEE / JakartaEE / Quarkus. In Spring (Boot) you use @Autowired, but constructor injection should also work, even with Lombok's @AllArgsConstructor. If it doesn't I'd check to see if Lombok actually runs. You can easily test this by making the field final; without a constructor that sets it (which Lombok should provide) the compiler will complain that it's not set.
Spring Boot hosts the JEE
Tomcat server, so I'd recommend @Inject over @Autowired. I believe that Spring Boot is providing that function as a built-in via Weld, as it's not part of Tomcat.
That's assuming I didn't get it as an automatic add-on when I built a Spring Boot JavaServer Faces app.
Traditonally, I'd be using @Autowired alongside
JSF's @ManagedBean, but @Inject can deal with both now.