diff --git a/spring-cloud-config/server/pom.xml b/spring-cloud-config/server/pom.xml new file mode 100644 index 0000000000..00eb0d34da --- /dev/null +++ b/spring-cloud-config/server/pom.xml @@ -0,0 +1,88 @@ + + + 4.0.0 + + com.baeldung.spring.cloud.config + server + 0.0.1-SNAPSHOT + jar + + server + Demo project for Spring Boot + + + org.springframework.boot + spring-boot-starter-parent + 1.3.7.RELEASE + + + + + UTF-8 + UTF-8 + 1.8 + + + + + org.springframework.cloud + spring-cloud-config-server + + + org.springframework.boot + spring-boot-starter-security + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.cloud + spring-cloud-dependencies + Brixton.BUILD-SNAPSHOT + pom + import + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/snapshot + + true + + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + false + + + + + diff --git a/spring-cloud-config/server/src/main/java/com/baeldung/spring/cloud/config/server/ConfigServer.java b/spring-cloud-config/server/src/main/java/com/baeldung/spring/cloud/config/server/ConfigServer.java new file mode 100644 index 0000000000..7010632eaa --- /dev/null +++ b/spring-cloud-config/server/src/main/java/com/baeldung/spring/cloud/config/server/ConfigServer.java @@ -0,0 +1,16 @@ +package com.baeldung.spring.cloud.config.server; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.config.server.EnableConfigServer; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; + +@SpringBootApplication +@EnableConfigServer +@EnableWebSecurity +public class ConfigServer { + + public static void main(String[] args) { + SpringApplication.run(ConfigServer.class, args); + } +} diff --git a/spring-cloud-config/server/src/main/resources/application.properties b/spring-cloud-config/server/src/main/resources/application.properties new file mode 100644 index 0000000000..cc84725748 --- /dev/null +++ b/spring-cloud-config/server/src/main/resources/application.properties @@ -0,0 +1,4 @@ +server.port=8888 +spring.cloud.config.server.git.uri=${CONFIG_REPO} +security.user.name=root +security.user.password=s3cr3t \ No newline at end of file diff --git a/spring-cloud-config/server/src/test/java/com/baeldung/spring/cloud/config/server/ConfigServerTests.java b/spring-cloud-config/server/src/test/java/com/baeldung/spring/cloud/config/server/ConfigServerTests.java new file mode 100644 index 0000000000..8ae78fcd1c --- /dev/null +++ b/spring-cloud-config/server/src/test/java/com/baeldung/spring/cloud/config/server/ConfigServerTests.java @@ -0,0 +1,18 @@ +package com.baeldung.spring.cloud.config.server; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.SpringApplicationConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.web.WebAppConfiguration; + +@RunWith(SpringJUnit4ClassRunner.class) +@SpringApplicationConfiguration(classes = ConfigServer.class) +@WebAppConfiguration +public class ConfigServerTests { + + @Test + public void contextLoads() { + } + +}