简体   繁体   中英

intellij idea reports cannot autowire beans for custom spring-boot-starter module

I have 2 starter modules: spring-boot-starter-vertx & spring-boot-starter-vertx-consul

consul starter depends on vertx starter

Intellij idea reports it cannot autowire Vertx bean for consul starter module (it's defined in vertx starter module)

But all modules build & run successfully by maven(include the module uses vertx & consul starters)

How to tell idea the Vertx bean is provided by another module to avoid the error report? (i've added ConditionalOnBean but the error remains)

I think you need to define dependency of module in Intellij Idea. In this way Intellij build module in predefined order and set them in class path.

for more information: https://www.jetbrains.com/help/idea/creating-and-managing-modules.html#working-with-module-dependencies

在ConsulConfiguration上使用@Import(VertxConfiguration.class)解决

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM