Skip to content

Commit

Permalink
增加eureka
Browse files Browse the repository at this point in the history
  • Loading branch information
beiyoufx committed Aug 9, 2018
1 parent 2f85705 commit f00a764
Show file tree
Hide file tree
Showing 6 changed files with 194 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,5 @@ hs_err_pid*
*.classpath
*.project
*.settings/*
/target/
/target/
*/target/*
73 changes: 73 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?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>

<description>
soraka is a spring cloud sample.
</description>

<!--基本信息-->
<groupId>com.soraka</groupId>
<artifactId>soraka</artifactId>
<version>1.0-SNAPSHOT</version>

<developers>
<developer>
<name>北有风雪</name>
<url>https://gitee.com/beiyoufx/soraka</url>
</developer>
</developers>

<!--属性-->
<properties>
<!-- 文件拷贝时的编码 -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- 编译时的编码 -->
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<fastjson.version>1.2.7</fastjson.version>
<spring.version>4.2.2.RELEASE</spring.version>
<mybatis.spring.version>1.2.4</mybatis.spring.version>
<mybatis.version>3.2.6</mybatis.version>
<dubbo.version>2.5.3</dubbo.version>
<junit.version>4.12</junit.version>
<log4j.version>1.2.17</log4j.version>
<slf4j.version>1.7.7</slf4j.version>
<xstream.version>1.4.4</xstream.version>
<druid.version>1.0.26</druid.version>
<mysql.connector.version>5.1.22</mysql.connector.version>
<jackson.version>2.9.0</jackson.version>
</properties>

<!--依赖-->
<dependencies></dependencies>
<!--依赖-->
<dependencyManagement></dependencyManagement>

<!--仓库-->
<repositories>
<repository>
<id>public</id>
<name>aliyun nexus</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>public</id>
<name>aliyun nexus</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
63 changes: 63 additions & 0 deletions soraka-eureka/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?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>

<groupId>com.soraka</groupId>
<artifactId>soraka-eureka</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>soraka-eureka</name>
<description>soraka注册中心</description>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-cloud.version>Finchley.SR1</spring-cloud.version>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>


</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.soraka.eureka;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;

/**
* Soraka注册中心
*
* @author yongjie.teng
* @date 2018/8/9
* @package com.soraka.eureka
*/
@EnableEurekaServer
@SpringBootApplication
public class SorakaEurekaApplication {
public static void main(String[] args) {
SpringApplication.run(SorakaEurekaApplication.class, args);
}
}
16 changes: 16 additions & 0 deletions soraka-eureka/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
spring:
application:
name: soraka-eureka

server:
port: 8001

eureka:
instance:
hostname: localhost
preferIpAddress: true
instance-id: ${spring.cloud.client.ipAddress}:${server.port}
client:
registerWithEureka: false
fetchRegistry: false

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.soraka.eureka;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
* @author yongjie.teng
* @date 2018/8/9
* @package com.soraka.eureka
*/
@RunWith(SpringRunner.class)
@SpringBootTest
public class SorakaEurekaApplicationTest {

@Test
public void contextLoads() {
}
}

0 comments on commit f00a764

Please sign in to comment.