简体   繁体   English

intellij创意报告无法为定制的spring-boot-starter模块自动接线bean

[英]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 我有2个启动程序模块:spring-boot-starter-vertx和spring-boot-starter-vertx-consul

consul starter depends on vertx starter 领事启动器取决于vertx启动器

Intellij idea reports it cannot autowire Vertx bean for consul starter module (it's defined in vertx starter module) Intellij Idea报告它无法为领事启动器模块自动接线Vertx Bean(在vertx启动器模块中定义)

But all modules build & run successfully by maven(include the module uses vertx & consul starters) 但是所有模块都由maven成功构建和运行(包括使用vertx和consul启动器的模块)

How to tell idea the Vertx bean is provided by another module to avoid the error report? 如何说出另一个模块提供Vertx bean以避免错误报告? (i've added ConditionalOnBean but the error remains) (我添加了ConditionalOnBean,但错误仍然存​​在)

I think you need to define dependency of module in Intellij Idea. 我认为您需要在Intellij Idea中定义模块的依赖关系。 In this way Intellij build module in predefined order and set them in class path. 通过这种方式,Intellij可以按预定义的顺序构建模块,并将其设置在类路径中。

for more information: https://www.jetbrains.com/help/idea/creating-and-managing-modules.html#working-with-module-dependencies 有关更多信息: https : //www.jetbrains.com/help/idea/creating-and-managing-modules.html#working-with-module-dependencies

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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