From bebaf6d3398b1274e112c7876261fd429662dd6e Mon Sep 17 00:00:00 2001 From: Felipe Santiago Corro Date: Fri, 6 Jul 2018 01:27:12 -0300 Subject: [PATCH] BAEL-1776: Add description and change module name (#4607) * Add description and change module name * Fix mvn parent in spring-boot-custom-starter --- spring-boot-custom-starter/README.md | 8 ++++++++ .../{greeter => greeter-library}/README.md | 0 .../{greeter => greeter-library}/pom.xml | 6 +++--- .../main/java/com/baeldung/greeter/library}/Greeter.java | 4 ++-- .../baeldung/greeter/library}/GreeterConfigParams.java | 2 +- .../com/baeldung/greeter/library}/GreetingConfig.java | 2 +- .../java/com/baeldung/greeter/GreeterIntegrationTest.java | 4 +++- .../greeter-spring-boot-autoconfigure/pom.xml | 8 +++++--- .../greeter/autoconfigure/GreeterAutoConfiguration.java | 6 +++--- .../baeldung/greeter/sample/GreeterSampleApplication.java | 2 +- .../sample/GreeterSampleApplicationIntegrationTest.java | 2 +- .../greeter-spring-boot-starter/pom.xml | 8 +++++--- spring-boot-custom-starter/pom.xml | 2 +- 13 files changed, 34 insertions(+), 20 deletions(-) rename spring-boot-custom-starter/{greeter => greeter-library}/README.md (100%) rename spring-boot-custom-starter/{greeter => greeter-library}/pom.xml (71%) rename spring-boot-custom-starter/{greeter/src/main/java/com/baeldung/greeter => greeter-library/src/main/java/com/baeldung/greeter/library}/Greeter.java (90%) rename spring-boot-custom-starter/{greeter/src/main/java/com/baeldung/greeter => greeter-library/src/main/java/com/baeldung/greeter/library}/GreeterConfigParams.java (90%) rename spring-boot-custom-starter/{greeter/src/main/java/com/baeldung/greeter => greeter-library/src/main/java/com/baeldung/greeter/library}/GreetingConfig.java (80%) rename spring-boot-custom-starter/{greeter => greeter-library}/src/test/java/com/baeldung/greeter/GreeterIntegrationTest.java (92%) diff --git a/spring-boot-custom-starter/README.md b/spring-boot-custom-starter/README.md index 5b05394d6e..aae79fe112 100644 --- a/spring-boot-custom-starter/README.md +++ b/spring-boot-custom-starter/README.md @@ -1,2 +1,10 @@ ### Relevant Articles: - [Creating a Custom Starter with Spring Boot](http://www.baeldung.com/spring-boot-custom-starter) + +- **greeter-library**: The sample library that we're creating the starter for. + +- **greeter-spring-boot-autoconfigure**: The project containing the auto-configuration for the library. + +- **greeter-spring-boot-starter**: The custom starter for the library. + +- **greeter-spring-boot-sample-app**: The sample project that uses the custom starter. \ No newline at end of file diff --git a/spring-boot-custom-starter/greeter/README.md b/spring-boot-custom-starter/greeter-library/README.md similarity index 100% rename from spring-boot-custom-starter/greeter/README.md rename to spring-boot-custom-starter/greeter-library/README.md diff --git a/spring-boot-custom-starter/greeter/pom.xml b/spring-boot-custom-starter/greeter-library/pom.xml similarity index 71% rename from spring-boot-custom-starter/greeter/pom.xml rename to spring-boot-custom-starter/greeter-library/pom.xml index aa45b8e6a4..3717ba005c 100644 --- a/spring-boot-custom-starter/greeter/pom.xml +++ b/spring-boot-custom-starter/greeter-library/pom.xml @@ -3,12 +3,12 @@ 4.0.0 com.baeldung - greeter + greeter-library 0.0.1-SNAPSHOT - parent-boot-1 + spring-boot-custom-starter com.baeldung 0.0.1-SNAPSHOT - ../../parent-boot-1 + ../../spring-boot-custom-starter \ No newline at end of file diff --git a/spring-boot-custom-starter/greeter/src/main/java/com/baeldung/greeter/Greeter.java b/spring-boot-custom-starter/greeter-library/src/main/java/com/baeldung/greeter/library/Greeter.java similarity index 90% rename from spring-boot-custom-starter/greeter/src/main/java/com/baeldung/greeter/Greeter.java rename to spring-boot-custom-starter/greeter-library/src/main/java/com/baeldung/greeter/library/Greeter.java index 970561d1fd..50fb31ddcb 100644 --- a/spring-boot-custom-starter/greeter/src/main/java/com/baeldung/greeter/Greeter.java +++ b/spring-boot-custom-starter/greeter-library/src/main/java/com/baeldung/greeter/library/Greeter.java @@ -1,6 +1,6 @@ -package com.baeldung.greeter; +package com.baeldung.greeter.library; -import static com.baeldung.greeter.GreeterConfigParams.*; +import static com.baeldung.greeter.library.GreeterConfigParams.*; import java.time.LocalDateTime; diff --git a/spring-boot-custom-starter/greeter/src/main/java/com/baeldung/greeter/GreeterConfigParams.java b/spring-boot-custom-starter/greeter-library/src/main/java/com/baeldung/greeter/library/GreeterConfigParams.java similarity index 90% rename from spring-boot-custom-starter/greeter/src/main/java/com/baeldung/greeter/GreeterConfigParams.java rename to spring-boot-custom-starter/greeter-library/src/main/java/com/baeldung/greeter/library/GreeterConfigParams.java index fa30b0f312..14cef3e92d 100644 --- a/spring-boot-custom-starter/greeter/src/main/java/com/baeldung/greeter/GreeterConfigParams.java +++ b/spring-boot-custom-starter/greeter-library/src/main/java/com/baeldung/greeter/library/GreeterConfigParams.java @@ -1,4 +1,4 @@ -package com.baeldung.greeter; +package com.baeldung.greeter.library; public class GreeterConfigParams { diff --git a/spring-boot-custom-starter/greeter/src/main/java/com/baeldung/greeter/GreetingConfig.java b/spring-boot-custom-starter/greeter-library/src/main/java/com/baeldung/greeter/library/GreetingConfig.java similarity index 80% rename from spring-boot-custom-starter/greeter/src/main/java/com/baeldung/greeter/GreetingConfig.java rename to spring-boot-custom-starter/greeter-library/src/main/java/com/baeldung/greeter/library/GreetingConfig.java index fbbe11cf4f..23d4ac0a0d 100644 --- a/spring-boot-custom-starter/greeter/src/main/java/com/baeldung/greeter/GreetingConfig.java +++ b/spring-boot-custom-starter/greeter-library/src/main/java/com/baeldung/greeter/library/GreetingConfig.java @@ -1,4 +1,4 @@ -package com.baeldung.greeter; +package com.baeldung.greeter.library; import java.util.Properties; diff --git a/spring-boot-custom-starter/greeter/src/test/java/com/baeldung/greeter/GreeterIntegrationTest.java b/spring-boot-custom-starter/greeter-library/src/test/java/com/baeldung/greeter/GreeterIntegrationTest.java similarity index 92% rename from spring-boot-custom-starter/greeter/src/test/java/com/baeldung/greeter/GreeterIntegrationTest.java rename to spring-boot-custom-starter/greeter-library/src/test/java/com/baeldung/greeter/GreeterIntegrationTest.java index 787f795480..2b09ecc615 100644 --- a/spring-boot-custom-starter/greeter/src/test/java/com/baeldung/greeter/GreeterIntegrationTest.java +++ b/spring-boot-custom-starter/greeter-library/src/test/java/com/baeldung/greeter/GreeterIntegrationTest.java @@ -1,10 +1,12 @@ package com.baeldung.greeter; -import static com.baeldung.greeter.GreeterConfigParams.*; +import static com.baeldung.greeter.library.GreeterConfigParams.*; import static org.junit.Assert.assertEquals; import java.time.LocalDateTime; +import com.baeldung.greeter.library.Greeter; +import com.baeldung.greeter.library.GreetingConfig; import org.junit.BeforeClass; import org.junit.Test; diff --git a/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml b/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml index 96647ea0f1..d70f176c20 100644 --- a/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml +++ b/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/pom.xml @@ -5,12 +5,14 @@ com.baeldung greeter-spring-boot-autoconfigure 0.0.1-SNAPSHOT + - parent-boot-1 + spring-boot-custom-starter com.baeldung 0.0.1-SNAPSHOT - ../../parent-boot-1 + ../../spring-boot-custom-starter + UTF-8 1.5.2.RELEASE @@ -40,7 +42,7 @@ com.baeldung - greeter + greeter-library ${greeter.version} true diff --git a/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/src/main/java/com/baeldung/greeter/autoconfigure/GreeterAutoConfiguration.java b/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/src/main/java/com/baeldung/greeter/autoconfigure/GreeterAutoConfiguration.java index 4cf078aa00..ae3f88f9ff 100644 --- a/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/src/main/java/com/baeldung/greeter/autoconfigure/GreeterAutoConfiguration.java +++ b/spring-boot-custom-starter/greeter-spring-boot-autoconfigure/src/main/java/com/baeldung/greeter/autoconfigure/GreeterAutoConfiguration.java @@ -1,6 +1,6 @@ package com.baeldung.greeter.autoconfigure; -import static com.baeldung.greeter.GreeterConfigParams.*; +import static com.baeldung.greeter.library.GreeterConfigParams.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; @@ -9,8 +9,8 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import com.baeldung.greeter.Greeter; -import com.baeldung.greeter.GreetingConfig; +import com.baeldung.greeter.library.Greeter; +import com.baeldung.greeter.library.GreetingConfig; @Configuration @ConditionalOnClass(Greeter.class) diff --git a/spring-boot-custom-starter/greeter-spring-boot-sample-app/src/main/java/com/baeldung/greeter/sample/GreeterSampleApplication.java b/spring-boot-custom-starter/greeter-spring-boot-sample-app/src/main/java/com/baeldung/greeter/sample/GreeterSampleApplication.java index 3c87524648..5aa3ac7015 100644 --- a/spring-boot-custom-starter/greeter-spring-boot-sample-app/src/main/java/com/baeldung/greeter/sample/GreeterSampleApplication.java +++ b/spring-boot-custom-starter/greeter-spring-boot-sample-app/src/main/java/com/baeldung/greeter/sample/GreeterSampleApplication.java @@ -5,7 +5,7 @@ import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import com.baeldung.greeter.Greeter; +import com.baeldung.greeter.library.Greeter; @SpringBootApplication public class GreeterSampleApplication implements CommandLineRunner { diff --git a/spring-boot-custom-starter/greeter-spring-boot-sample-app/src/test/java/com/baeldung/greeter/sample/GreeterSampleApplicationIntegrationTest.java b/spring-boot-custom-starter/greeter-spring-boot-sample-app/src/test/java/com/baeldung/greeter/sample/GreeterSampleApplicationIntegrationTest.java index a4816cf319..50193ccd60 100644 --- a/spring-boot-custom-starter/greeter-spring-boot-sample-app/src/test/java/com/baeldung/greeter/sample/GreeterSampleApplicationIntegrationTest.java +++ b/spring-boot-custom-starter/greeter-spring-boot-sample-app/src/test/java/com/baeldung/greeter/sample/GreeterSampleApplicationIntegrationTest.java @@ -10,7 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import com.baeldung.greeter.Greeter; +import com.baeldung.greeter.library.Greeter; @RunWith(SpringJUnit4ClassRunner.class) @SpringBootTest(classes = GreeterSampleApplication.class) diff --git a/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml b/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml index 7bf13eebc8..af1a77d138 100644 --- a/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml +++ b/spring-boot-custom-starter/greeter-spring-boot-starter/pom.xml @@ -5,12 +5,14 @@ com.baeldung greeter-spring-boot-starter 0.0.1-SNAPSHOT + - parent-boot-1 + spring-boot-custom-starter com.baeldung 0.0.1-SNAPSHOT - ../../parent-boot-1 + ../../spring-boot-custom-starter + UTF-8 0.0.1-SNAPSHOT @@ -33,7 +35,7 @@ com.baeldung - greeter + greeter-library ${greeter.version} diff --git a/spring-boot-custom-starter/pom.xml b/spring-boot-custom-starter/pom.xml index 1bc0e14d8e..def089e9a9 100644 --- a/spring-boot-custom-starter/pom.xml +++ b/spring-boot-custom-starter/pom.xml @@ -13,7 +13,7 @@ - greeter + greeter-library greeter-spring-boot-autoconfigure greeter-spring-boot-starter greeter-spring-boot-sample-app