<?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>cn.home1</groupId>
        <artifactId>oss-build</artifactId>
        <version>1.0.11.OSS</version>
    </parent>

    <artifactId>oss-eureka</artifactId>
    <description>Eureka</description>
    <name>oss-eureka</name>
    <packaging>jar</packaging>
    <url>https://github.com/home1-oss/oss-eureka</url>
    <version>1.0.7.OSS</version>

    <ciManagement>
        <system>Travis CI</system>
        <url>https://travis-ci.org/home1-oss/oss-eureka</url>
    </ciManagement>
    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/home1-oss/oss-eureka/issues</url>
    </issueManagement>
    <scm>
        <connection>scm:git:https://github.com/home1-oss/oss-eureka.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/home1-oss/oss-eureka.git</developerConnection>
        <url>https://github.com/home1-oss/oss-eureka</url>
    </scm>

    <properties>
        <spring-boot-admin.version>1.4.1</spring-boot-admin.version>
        <spring-boot.version>1.4.1.RELEASE</spring-boot.version>
        <oss-release.version>1.0.6.OSS</oss-release.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>${spring-boot.version}</version>
                <configuration>
                    <classifier>exec</classifier>
                    <mainClass>cn.home1.oss.environment.eureka.EurekaServer</mainClass>
                    <layout>ZIP</layout>
                    <excludes>
                        <exclude>
                            <groupId>org.inferred</groupId>
                            <artifactId>freebuilder</artifactId>
                        </exclude>
                        <exclude>
                            <groupId>com.google.auto.value</groupId>
                            <artifactId>auto-value</artifactId>
                        </exclude>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                    <requiresUnpack>
                        <dependency>
                            <groupId>com.netflix.eureka</groupId>
                            <artifactId>eureka-core</artifactId>
                        </dependency>
                        <dependency>
                            <groupId>com.netflix.eureka</groupId>
                            <artifactId>eureka-client</artifactId>
                        </dependency>
                    </requiresUnpack>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                        <configuration>
                            <attach>false</attach>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.spotify</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <configuration>
                    <serverId>docker-hub</serverId>
                    <!--registryUrl>https://index.docker.io/v1/</registryUrl-->
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>cn.home1</groupId>
                <artifactId>oss-release-spring-boot-${spring-boot.version}</artifactId>
                <version>${oss-release.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>cn.home1</groupId>
            <artifactId>oss-lib-swagger-spring-boot-${spring-boot.version}</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-eureka-server</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-netflix-core</artifactId>
        </dependency>
        <!-- TODO test scope ? -->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-ribbon</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jetty</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-log4j2</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-starter-client</artifactId>
            <version>${spring-boot-admin.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.jolokia</groupId>
            <artifactId>jolokia-core</artifactId>
            <scope>runtime</scope>
        </dependency>

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

        <!-- 添加测试环境的依赖 -->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-eureka</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- 测试feign -->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-feign</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
