dsj 5 years ago
parent
commit
382b0023d2

+ 37 - 0
pom.xml

@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>com.hcloud.microserver</groupId>
+        <artifactId>common-parent</artifactId>
+        <version>0.0.1-SNAPSHOT</version>
+        <relativePath>../common-parent/pom.xml</relativePath>
+    </parent>
+
+    <groupId>com.hcloud.microserver</groupId>
+    <artifactId>eureka-register-server</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
+           <version>1.4.4.RELEASE</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-security</artifactId>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+</project>

+ 13 - 0
src/main/java/com/hcloud/server/EurekaApplication.java

@@ -0,0 +1,13 @@
+package com.hcloud.server;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
+
+@SpringBootApplication
+@EnableEurekaServer
+public class EurekaApplication {
+    public static void main(String[] args) {
+        SpringApplication.run(EurekaApplication.class, args);
+    }
+}

+ 10 - 0
src/main/resources/application-dev.properties

@@ -0,0 +1,10 @@
+server.port=8761
+spring.application.name=eureka-register-server
+eureka.client.service-url.defaultZone=http://127.0.0.1:8761/eureka/
+eureka.client.registerWithEureka=false
+eureka.client.fetchRegistry=false
+eureka.server.enable-self-preservation=false
+eureka.server.PeerNodeReadTimeoutMs=5000
+security.basic.enabled=false
+security.user.name=todd
+security.user.password=todd123

+ 10 - 0
src/main/resources/application-pro.properties

@@ -0,0 +1,10 @@
+server.port=20880
+spring.application.name = eureka-register-server
+eureka.client.service-url.defaultZone=http://localhost:20880/eureka/
+eureka.client.registerWithEureka=false
+eureka.client.fetchRegistry=false
+eureka.server.enable-self-preservation=false
+eureka.server.PeerNodeReadTimeoutMs=5000
+security.basic.enabled=true
+security.user.name=todd
+security.user.password=todd123

+ 10 - 0
src/main/resources/application-test.properties

@@ -0,0 +1,10 @@
+server.port=8761
+spring.application.name=eureka-register-server
+eureka.client.service-url.defaultZone=http://127.0.0.1:8761/eureka/
+eureka.client.registerWithEureka=false
+eureka.client.fetchRegistry=false
+eureka.server.enable-self-preservation=false
+eureka.server.PeerNodeReadTimeoutMs=5000
+security.basic.enabled=false
+security.user.name=todd
+security.user.password=todd123

+ 1 - 0
src/main/resources/application.properties

@@ -0,0 +1 @@
+spring.profiles.active=dev