简体   繁体   English

如何配置 intellij 以查找 spring 属性源

[英]How to configure intellij to find spring properties source


I'm looking for a way to follow source of spring configuration from annotation.我正在寻找一种方法来从注释中跟踪 spring 配置的来源。
Eg Having below Bean is any way to eg click on my-components-service.books.configurations and be redirect or list yaml files which contains config which would be injected in runtime?例如,拥有下面的 Bean 是否有任何方法可以例如单击my-components-service.books.configurations并重定向或列出 yaml 文件,其中包含将在运行时注入的配置?

@Bean
@ConfigurationProperties(prefix = "my-components-service.books.configurations")
Map<ComponentType, BooksConfiguration> booksConfiguration() {
  return new HashMap<>();
}

If @ConfigurationProperties is at the class level then there should be some gutter icons that will show where the properties have been set.如果@ConfigurationProperties处于 class 级别,那么应该有一些装订线图标将显示设置属性的位置。 IntelliJ spring boot 属性装订线弹出窗口

It doesn't look like this works when it's specified on a @Bean like in your example however.但是,当它像您的示例中那样在@Bean上指定时,它看起来不起作用。 A possible workaround is to use a nested @Configuration class, though that may be undesirable.一种可能的解决方法是使用嵌套的@Configuration class,尽管这可能是不可取的。 在此处输入图像描述

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

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