<?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">
    <parent>
        <artifactId>monitor</artifactId>
        <groupId>com.usthe.tancloud</groupId>
        <version>1.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>manager</artifactId>
    <packaging>jar</packaging>

    <properties>
        <mysql.version>8.0.16</mysql.version>
        <snake.yaml.version>1.26</snake.yaml.version>
        <sureness-core.version>1.0.5</sureness-core.version>
    </properties>

    <dependencies>
        <!-- common -->
        <dependency>
            <groupId>com.usthe.tancloud</groupId>
            <artifactId>common</artifactId>
            <version>1.0</version>
        </dependency>
        <!-- data warehouse -->
        <dependency>
            <groupId>com.usthe.tancloud</groupId>
            <artifactId>warehouse</artifactId>
            <version>1.0</version>
        </dependency>
        <!-- alerter -->
        <dependency>
            <groupId>com.usthe.tancloud</groupId>
            <artifactId>alerter</artifactId>
            <version>1.0</version>
        </dependency>
        <!-- collector -->
        <dependency>
            <groupId>com.usthe.tancloud</groupId>
            <artifactId>collector</artifactId>
            <version>1.0</version>
        </dependency>
        <!-- spring -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>
        <!-- data jdbc -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <!-- mysql -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>${mysql.version}</version>
            <!--<scope>runtime</scope>-->
        </dependency>
        <!-- email -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-mail</artifactId>
        </dependency>
        <!-- swagger -->
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-boot-starter</artifactId>
        </dependency>
        <!-- yaml file load -->
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>${snake.yaml.version}</version>
        </dependency>
        <!-- validation -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-validation</artifactId>
        </dependency>
        <!--sureness-->
        <dependency>
            <groupId>com.usthe.sureness</groupId>
            <artifactId>spring-boot-starter-sureness</artifactId>
            <version>1.0.6.beta1</version>
        </dependency>
    </dependencies>

    <build>
        <finalName>hertz-beat</finalName>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>application.yml</include>
                    <include>sureness.yml</include>
                    <include>banner.txt</include>
                    <include>define/**</include>
                </includes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <classesDirectory>target/classes/</classesDirectory>
                    <archive>
                        <!--生成的jar包不包含maven描述相关文件-->
                        <addMavenDescriptor>false</addMavenDescriptor>
                        <manifest>
                            <!--项目启动类-->
                            <mainClass>com.usthe.manager.Manager</mainClass>
                            <useUniqueVersions>false</useUniqueVersions>
                            <!--第三方JAR加入类构建的路径maven-dependency-plugin-->
                            <addClasspath>true</addClasspath>
                            <!--外部依赖jar包的位置-->
                            <classpathPrefix>lib/</classpathPrefix>
                        </manifest>
                        <manifestEntries>
                            <Class-Path>. config</Class-Path>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <!--关键插件,maven提供的assembly插件,需要放在最后-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>3.3.0</version>
                <executions>
                    <execution>
                        <id>make-zip</id>
                        <!--绑定的maven操作-->
                        <phase>package</phase>
                        <!--运行一次-->
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <descriptors>
                                <descriptor>../script/assembly/server/assembly.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>