case 1: condition is not matched
@ConditionalOnProperty("test.trustStore")
@AutoConfiguration
public class MyAutoConfiguration {
}
application.yaml
test:
trust-store: classpath:ssl/truststore.jks
case 2: condition is matched
@ConditionalOnProperty("test.trust-store")
@AutoConfiguration
public class MyAutoConfiguration {
}
application.yaml
test:
trustStore: classpath:ssl/truststore.jks
reason
After debug the source code, I found the reason: org.springframework.boot.context.properties.source.ConfigurationPropertyName.ElementsParser#isAlpha
private static boolean isAlpha(char ch) {
return ch >= 'a' && ch <= 'z';
}
Can we change it to support uppercase letters?If so, I'd like to submmit a PR.
Comment From: wilkinsona
This is intentional. Please see the javadoc for name attribute:
Use the dashed notation to specify each property, that is all lower case with a "-" to separate words (e.g.
my-long-property).
Using this canonical format in the annotation ensures that it can match against a variety of different input formats.