Can Idea automatically autowires Spring Bean using @Resource instead of @Autowired?

已回答

I love this new feature, but it's @Autowired not @Resouce, Can I change this?

below is the bean

help

1

Hello,

Is it possible to provide sample project example demonstrating the issue?

-2

Seems like this would be super easy to reproduce no? Just create a project with spring, define a bean and attempt to use it in a class that doesn't have it imported yet. @Resource is more standard than @Autowired, which is spring-specific.

0
IntelliJ IDEA, by default, does not automatically use `@Resource` instead of `@Autowired` for Spring bean injection. It focuses on embracing Spring's native functionality, which primarily revolves around `@Autowired`.
An option is to create or adjust live templates to insert `@Resource` instead of `@Autowired`.
0

请先登录再写评论。