`@ConditionalOnProperty` target property with no metadata
See original GitHub issueSeveral 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.task.batch.configuration.TaskBatchAutoConfiguration [spring.cloud.task.batch.listener.enable|spring.cloud.task.batch.listener.enabled]
org.springframework.cloud.task.batch.configuration.TaskJobLauncherAutoConfiguration [spring.cloud.task.batch.failOnJobFailure]
org.springframework.cloud.task.batch.listener.BatchEventAutoConfiguration [spring.cloud.task.batch.events.enabled]
org.springframework.cloud.task.batch.listener.BatchEventAutoConfiguration.JobExecutionListenerConfiguration#chunkEventsListener [spring.cloud.task.batch.events.chunk.enabled]
org.springframework.cloud.task.batch.listener.BatchEventAutoConfiguration.JobExecutionListenerConfiguration#itemProcessEventsListener [spring.cloud.task.batch.events.item-process.enabled]
org.springframework.cloud.task.batch.listener.BatchEventAutoConfiguration.JobExecutionListenerConfiguration#itemReadEventsListener [spring.cloud.task.batch.events.item-read.enabled]
org.springframework.cloud.task.batch.listener.BatchEventAutoConfiguration.JobExecutionListenerConfiguration#itemWriteEventsListener [spring.cloud.task.batch.events.item-write.enabled]
org.springframework.cloud.task.batch.listener.BatchEventAutoConfiguration.JobExecutionListenerConfiguration#jobExecutionEventsListener [spring.cloud.task.batch.events.job-execution.enabled]
org.springframework.cloud.task.batch.listener.BatchEventAutoConfiguration.JobExecutionListenerConfiguration#skipEventsListener [spring.cloud.task.batch.events.skip.enabled]
org.springframework.cloud.task.batch.listener.BatchEventAutoConfiguration.JobExecutionListenerConfiguration#stepExecutionEventsListener [spring.cloud.task.batch.events.step-execution.enabled]
org.springframework.cloud.task.configuration.SingleTaskConfiguration [spring.cloud.task.singleInstanceEnabled]
org.springframework.cloud.task.listener.TaskEventAutoConfiguration [spring.cloud.task.events.enabled]
Also, please note that properties in @ConditionalOnPropety
have to be defined with the canonical format (so spring.cloud.task.singleInstanceEnabled
must be spring.cloud.task.single-instance-enabled
for instance).
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
`@ConditionalOnProperty` target property with no metadata · Issue ...
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...
Read more >`@ConditionalOnProperty` target property with no metadata
Several auto-configurations use a condition on a property that has no metadata. As a result, trying to use it to customize the ...
Read more >ConditionalOnProperty and "defaultValue": true - Stack Overflow
Hm, right, that will solve the issue. But is there any way to specify the default value for the property? If no, I'll...
Read more >ConditionalOnProperty (Spring Boot Docs 1.3.0.RELEASE API)
Conditional that checks if the specified properties have a specific value. By default the properties must be present in the Environment and not...
Read more >The Spring @ConditionalOnProperty Annotation - Baeldung
For example, we may want to register a DataSource bean to point to a production or test database depending on if we set...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thx, good point as I really didn’t get that into my radar!
PR created https://github.com/spring-cloud/spring-cloud-task/pull/468. Thanks for catching this!