Merge pull request #13950 from zahikhan/master
Spring Boot Properties Prefix Must Be in Canonical Form
This commit is contained in:
commit
f38b976997
|
@ -0,0 +1,12 @@
|
||||||
|
package com.baeldung.error;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
public class KebabCasingDemoApplication {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(KebabCasingDemoApplication.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.baeldung.error.configuration;
|
||||||
|
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@ConfigurationProperties(prefix = "profile.profileProperties")
|
||||||
|
public class MainConfiguration {
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(final String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
}
|
|
@ -31,4 +31,13 @@ bael.property=prodValue
|
||||||
environment.name=${OS}
|
environment.name=${OS}
|
||||||
java.home.and.environment=${JAVA_HOME}+${OS}
|
java.home.and.environment=${JAVA_HOME}+${OS}
|
||||||
not.existing.system.property=${thispropertydoesnotexist}
|
not.existing.system.property=${thispropertydoesnotexist}
|
||||||
baeldung.presentation=${HELLO_BAELDUNG}. Java is installed in the folder: ${JAVA_HOME}
|
baeldung.presentation=${HELLO_BAELDUNG}. Java is installed in the folder: ${JAVA_HOME}
|
||||||
|
#---
|
||||||
|
#camelCasing
|
||||||
|
#profile.applicationProperties.name="Baeldung"
|
||||||
|
#PascalCasing
|
||||||
|
#profile.ApplicationProperties.name="Baeldung"
|
||||||
|
#SnakingCasing
|
||||||
|
#profile.application_properties.name="Baeldung"
|
||||||
|
#KebabCasing
|
||||||
|
profile.application-properties.name="Baeldung"
|
Loading…
Reference in New Issue