From d8a3dd3d71acd94a052fa6a2ebebd5da21ca386e Mon Sep 17 00:00:00 2001 From: Zahid Khan Date: Mon, 15 May 2023 11:47:27 +0530 Subject: [PATCH] Fix formatting issues, refactor the `profiles` word in the properties. --- .../error/KebabCasingDemoApplication.java | 8 ++++---- .../configuration/MainConfiguration.java | 20 +++++++++---------- .../src/main/resources/application.properties | 8 ++++---- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/error/KebabCasingDemoApplication.java b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/error/KebabCasingDemoApplication.java index 7b97f97ffa..772580c816 100644 --- a/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/error/KebabCasingDemoApplication.java +++ b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/error/KebabCasingDemoApplication.java @@ -5,8 +5,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class KebabCasingDemoApplication { - public static void main(String[] args) { - SpringApplication.run(KebabCasingDemoApplication.class, args); - } - + public static void main(String[] args) { + SpringApplication.run(KebabCasingDemoApplication.class, args); + } + } diff --git a/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/error/configuration/MainConfiguration.java b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/error/configuration/MainConfiguration.java index 3c5fbc3006..a61c64cfbe 100644 --- a/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/error/configuration/MainConfiguration.java +++ b/spring-boot-modules/spring-boot-properties-3/src/main/java/com/baeldung/error/configuration/MainConfiguration.java @@ -4,15 +4,15 @@ import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Configuration; @Configuration -@ConfigurationProperties(prefix = "profile.profileProperties") +@ConfigurationProperties(prefix = "customProperties") public class MainConfiguration { - private String name; - - public String getName() { - return name; - } - - public void setName(final String name) { - this.name = name; - } + private String name; + + public String getName() { + return name; + } + + public void setName(final String name) { + this.name = name; + } } diff --git a/spring-boot-modules/spring-boot-properties-3/src/main/resources/application.properties b/spring-boot-modules/spring-boot-properties-3/src/main/resources/application.properties index e80c2ecc27..225ebb05b6 100644 --- a/spring-boot-modules/spring-boot-properties-3/src/main/resources/application.properties +++ b/spring-boot-modules/spring-boot-properties-3/src/main/resources/application.properties @@ -34,10 +34,10 @@ not.existing.system.property=${thispropertydoesnotexist} baeldung.presentation=${HELLO_BAELDUNG}. Java is installed in the folder: ${JAVA_HOME} #--- #camelCasing -#profile.applicationProperties.name="Baeldung" +#customProperties.name="Baeldung" #PascalCasing -#profile.ApplicationProperties.name="Baeldung" +#CustomProperties.name="Baeldung" #SnakingCasing -#profile.application_properties.name="Baeldung" +#custom_properties.name="Baeldung" #KebabCasing -profile.application-properties.name="Baeldung" \ No newline at end of file +custom-properties.name="Baeldung" \ No newline at end of file