Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@ConditionalOnProperty target property with no metadata #174

Open
snicoll opened this issue Aug 28, 2018 · 4 comments
Open

@ConditionalOnProperty target property with no metadata #174

snicoll opened this issue Aug 28, 2018 · 4 comments
Labels

Comments

@snicoll
Copy link

snicoll commented Aug 28, 2018

Several auto-configurations use a condition on a property that has no metadata. As a result, trying to use it to customize the auto-configuration lead to a warning in an IDE.

The report detected the following:

org.springframework.cloud.zookeeper.config.ZookeeperConfigAutoConfiguration [spring.cloud.zookeeper.config.enabled]
org.springframework.cloud.zookeeper.config.ZookeeperConfigAutoConfiguration.ZkRefreshConfiguration#configWatcher [spring.cloud.zookeeper.config.watcher.enabled]
org.springframework.cloud.zookeeper.discovery.ConditionalOnRibbonZookeeper [ribbon.zookeeper.enabled]
org.springframework.cloud.zookeeper.discovery.ZookeeperRibbonClientConfiguration#dependenciesBasedLoadBalancer [spring.cloud.zookeeper.dependency.ribbon.loadbalancer]
org.springframework.cloud.zookeeper.discovery.dependency.DependencyFeignClientAutoConfiguration [spring.cloud.zookeeper.dependency.headers.enabled]
org.springframework.cloud.zookeeper.discovery.dependency.DependencyRestTemplateAutoConfiguration [spring.cloud.zookeeper.dependency.resttemplate.enabled]
org.springframework.cloud.zookeeper.discovery.dependency.DependencyRibbonAutoConfiguration#loadBalancerClient [spring.cloud.zookeeper.dependency.ribbon.enabled]
org.springframework.cloud.zookeeper.serviceregistry.ZookeeperServiceRegistryAutoConfiguration [spring.cloud.service-registry.enabled]
@hu-chia
Copy link

hu-chia commented Mar 11, 2020

BTW, spring-cloud-zookeeper-config:2.2.1-RELEASE do not have spring-autoconfigure-metadata and additional-spring-autoconfigure-metadata.

image

@ryanjbaxter
Copy link
Contributor

Fixed via 009ee54

@snicoll
Copy link
Author

snicoll commented Dec 7, 2020

@ryanjbaxter I don't think that commit fixed the problem I reported.

Taking the first example in the description above (updated with recent code): spring.cloud.zookeeper.enabled is used in ConditionalOnZookeeperEnabled but there is no metadata for that property. It is flagged as unresolved as far as I know.

@snicoll snicoll reopened this Dec 7, 2020
@ryanjbaxter ryanjbaxter added this to the 3.0.0-RC1 milestone Dec 7, 2020
@ryanjbaxter
Copy link
Contributor

Sorry @snicoll I didnt check the issues the PR claimed it fixed, thanks for reopening.

@spencergibb spencergibb removed this from the 3.0.0-RC1 milestone Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants