Skip to content

Commit f4bbe5c

Browse files
Server second draft.
1 parent f32ce20 commit f4bbe5c

4 files changed

Lines changed: 126 additions & 0 deletions

File tree

‎spring-cloud-config/server/pom.xml‎

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<groupId>com.baeldung.spring.cloud.config</groupId>
7+
<artifactId>server</artifactId>
8+
<version>0.0.1-SNAPSHOT</version>
9+
<packaging>jar</packaging>
10+
11+
<name>server</name>
12+
<description>Demo project for Spring Boot</description>
13+
14+
<parent>
15+
<groupId>org.springframework.boot</groupId>
16+
<artifactId>spring-boot-starter-parent</artifactId>
17+
<version>1.3.7.RELEASE</version>
18+
<relativePath/> <!-- lookup parent from repository -->
19+
</parent>
20+
21+
<properties>
22+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
23+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
24+
<java.version>1.8</java.version>
25+
</properties>
26+
27+
<dependencies>
28+
<dependency>
29+
<groupId>org.springframework.cloud</groupId>
30+
<artifactId>spring-cloud-config-server</artifactId>
31+
</dependency>
32+
<dependency>
33+
<groupId>org.springframework.boot</groupId>
34+
<artifactId>spring-boot-starter-security</artifactId>
35+
</dependency>
36+
<dependency>
37+
<groupId>org.springframework.boot</groupId>
38+
<artifactId>spring-boot-starter-web</artifactId>
39+
</dependency>
40+
41+
<dependency>
42+
<groupId>org.springframework.boot</groupId>
43+
<artifactId>spring-boot-starter-test</artifactId>
44+
<scope>test</scope>
45+
</dependency>
46+
</dependencies>
47+
48+
<dependencyManagement>
49+
<dependencies>
50+
<dependency>
51+
<groupId>org.springframework.cloud</groupId>
52+
<artifactId>spring-cloud-dependencies</artifactId>
53+
<version>Brixton.BUILD-SNAPSHOT</version>
54+
<type>pom</type>
55+
<scope>import</scope>
56+
</dependency>
57+
</dependencies>
58+
</dependencyManagement>
59+
60+
<build>
61+
<plugins>
62+
<plugin>
63+
<groupId>org.springframework.boot</groupId>
64+
<artifactId>spring-boot-maven-plugin</artifactId>
65+
</plugin>
66+
</plugins>
67+
</build>
68+
69+
<repositories>
70+
<repository>
71+
<id>spring-snapshots</id>
72+
<name>Spring Snapshots</name>
73+
<url>https://repo.spring.io/snapshot</url>
74+
<snapshots>
75+
<enabled>true</enabled>
76+
</snapshots>
77+
</repository>
78+
<repository>
79+
<id>spring-milestones</id>
80+
<name>Spring Milestones</name>
81+
<url>https://repo.spring.io/milestone</url>
82+
<snapshots>
83+
<enabled>false</enabled>
84+
</snapshots>
85+
</repository>
86+
</repositories>
87+
88+
</project>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.baeldung.spring.cloud.config.server;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
import org.springframework.cloud.config.server.EnableConfigServer;
6+
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
7+
8+
@SpringBootApplication
9+
@EnableConfigServer
10+
@EnableWebSecurity
11+
public class ConfigServer {
12+
13+
public static void main(String[] args) {
14+
SpringApplication.run(ConfigServer.class, args);
15+
}
16+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
server.port=8888
2+
spring.cloud.config.server.git.uri=${CONFIG_REPO}
3+
security.user.name=root
4+
security.user.password=s3cr3t
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.baeldung.spring.cloud.config.server;
2+
3+
import org.junit.Test;
4+
import org.junit.runner.RunWith;
5+
import org.springframework.boot.test.SpringApplicationConfiguration;
6+
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
7+
import org.springframework.test.context.web.WebAppConfiguration;
8+
9+
@RunWith(SpringJUnit4ClassRunner.class)
10+
@SpringApplicationConfiguration(classes = ConfigServer.class)
11+
@WebAppConfiguration
12+
public class ConfigServerTests {
13+
14+
@Test
15+
public void contextLoads() {
16+
}
17+
18+
}

0 commit comments

Comments
 (0)