<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

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

    <groupId>com.lantone</groupId>
    <artifactId>emrais</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>emrais</name>
    <packaging>pom</packaging>
    <description>电子病历人工智能服务</description>

    <modules>
        <module>register-center</module>
        <module>config-center</module>
        <module>common</module>
        <module>structure-center</module>
        <module>gateway-service</module>
        <module>monitor-service</module>
        <module>security-center</module>
        <module>dblayer-mbg</module>
        <module>user-auth</module>
        <module>message-service</module>
        <module>bus-interceptor</module>
        <module>report-service</module>
    </modules>

    <properties>
        <java.version>1.8</java.version>
        <spring-cloud.version>Hoxton.SR5</spring-cloud.version>
        <spring-boot-admin-starter-server.version>2.2.3</spring-boot-admin-starter-server.version>
        <mybatis-plus.version>3.2.0</mybatis-plus.version>
        <mysql-connector-java.version>8.0.18</mysql-connector-java.version>
        <ojdbc6.version>11.2.0.3</ojdbc6.version>
        <druid-spring-boot-starter.version>1.1.16</druid-spring-boot-starter.version>
        <velocity-engine-core.version>2.1</velocity-engine-core.version>
        <freemarker.version>2.3.29</freemarker.version>
        <beetl.version>3.0.13.RELEASE</beetl.version>
        <lombok.version>1.18.8</lombok.version>
        <guava.version>28.1-jre</guava.version>
        <bitwalker.version>1.21</bitwalker.version>
        <hutool-all.version>5.4.0</hutool-all.version>
        <knife4j-micro-spring-boot-starter.version>2.0.4</knife4j-micro-spring-boot-starter.version>
        <commons-lang3.version>3.8.1</commons-lang3.version>
        <fastjson.version>1.2.62</fastjson.version>
        <gson.version>2.8.5</gson.version>
        <commons-codec.version>1.11</commons-codec.version>
        <poi.version>4.0.1</poi.version>
        <commons-beanutils.version>1.9.3</commons-beanutils.version>
        <nimbus-jose-jwt.version>8.16</nimbus-jose-jwt.version>
        <java-jwt.version>3.4.0</java-jwt.version>
        <spring-data-commons.version>2.3.0.RELEASE</spring-data-commons.version>
        <jackson-databind.version>2.12.3</jackson-databind.version>
        <validation-api.version>2.0.1.Final</validation-api.version>
        <common.version>0.0.1-SNAPSHOT</common.version>
        <dblayer-mbg.version>0.0.1-SNAPSHOT</dblayer-mbg.version>
        <txlcn-tc.version>5.0.2.RELEASE</txlcn-tc.version>
        <txlcn-txmsg-netty.version>5.0.2.RELEASE</txlcn-txmsg-netty.version>
        <docker-maven-plugin.version>1.2.2</docker-maven-plugin.version>
        <registryUrl>192.168.2.125:4490</registryUrl>
        <serverId>private-registry</serverId>
        <harbor.folder>emrais</harbor.folder>
    </properties>

    <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>

            <!-- 通用模块 -->
            <dependency>
                <groupId>com.lantone</groupId>
                <artifactId>common</artifactId>
                <version>${common.version}</version>
            </dependency>
            <!-- MBG生成模块 -->
            <dependency>
                <groupId>com.lantone</groupId>
                <artifactId>dblayer-mbg</artifactId>
                <version>${dblayer-mbg.version}</version>
            </dependency>

            <!-- mybatisplus 依赖 -->
            <dependency>
                <groupId>com.baomidou</groupId>
                <artifactId>mybatis-plus-boot-starter</artifactId>
                <version>${mybatis-plus.version}</version>
            </dependency>
            <dependency>
                <groupId>com.baomidou</groupId>
                <artifactId>mybatis-plus-extension</artifactId>
                <version>${mybatis-plus.version}</version>
            </dependency>

            <!-- mysql数据库依赖 依赖 -->
            <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
                <version>${mysql-connector-java.version}</version>
            </dependency>

            <!-- oracle数据库依赖 依赖 -->
            <dependency>
                <groupId>com.oracle</groupId>
                <artifactId>ojdbc6</artifactId>
                <version>${ojdbc6.version}</version>
            </dependency>

            <!-- 阿里druid连接池 依赖 -->
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>druid-spring-boot-starter</artifactId>
                <version>${druid-spring-boot-starter.version}</version>
            </dependency>

            <!-- mybatisplus 代码生成器所依赖的jar包 包括3种不同类型的模板依赖-->
            <dependency>
                <groupId>com.baomidou</groupId>
                <artifactId>mybatis-plus-generator</artifactId>
                <version>${mybatis-plus.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.velocity</groupId>
                <artifactId>velocity-engine-core</artifactId>
                <version>${velocity-engine-core.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.freemarker</groupId>
                <artifactId>freemarker</artifactId>
                <version>${freemarker.version}</version>
            </dependency>
            <dependency>
                <groupId>com.ibeetl</groupId>
                <artifactId>beetl</artifactId>
                <version>${beetl.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${lombok.version}</version>
                <!--<scope>provided</scope>-->
                <!--<optional>true</optional>-->
            </dependency>

            <!-- 分布式事务框架 tx-lcn -->
            <dependency>
                <groupId>com.codingapi.txlcn</groupId>
                <artifactId>txlcn-tc</artifactId>
                <version>${txlcn-tc.version}</version>
            </dependency>
            <dependency>
                <groupId>com.codingapi.txlcn</groupId>
                <artifactId>txlcn-txmsg-netty</artifactId>
                <version>${txlcn-txmsg-netty.version}</version>
            </dependency>

            <!--guava Java工具包-->
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>

            <!--Hutool Java工具包-->
            <dependency>
                <groupId>cn.hutool</groupId>
                <artifactId>hutool-all</artifactId>
                <version>${hutool-all.version}</version>
            </dependency>

            <!-- Knife4j API文档生产工具 -->
            <dependency>
                <groupId>com.github.xiaoymin</groupId>
                <artifactId>knife4j-micro-spring-boot-starter</artifactId>
                <version>${knife4j-micro-spring-boot-starter.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.xiaoymin</groupId>
                <artifactId>knife4j-spring-boot-starter</artifactId>
                <version>${knife4j-micro-spring-boot-starter.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${commons-lang3.version}</version>
            </dependency>

            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>fastjson</artifactId>
                <version>${fastjson.version}</version>
            </dependency>

            <dependency>
                <groupId>com.google.code.gson</groupId>
                <artifactId>gson</artifactId>
                <version>${gson.version}</version>
            </dependency>

            <dependency>
                <groupId>commons-codec</groupId>
                <artifactId>commons-codec</artifactId>
                <version>${commons-codec.version}</version>
            </dependency>

            <!-- 解析客户端操作系统、浏览器等 -->
            <dependency>
                <groupId>eu.bitwalker</groupId>
                <artifactId>UserAgentUtils</artifactId>
                <version>${bitwalker.version}</version>
            </dependency>

            <!-- poi excel -->
            <dependency>
                <groupId>org.apache.poi</groupId>
                <artifactId>poi</artifactId>
                <version>${poi.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.poi</groupId>
                <artifactId>poi-ooxml</artifactId>
                <version>${poi.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-beanutils</groupId>
                <artifactId>commons-beanutils</artifactId>
                <version>${commons-beanutils.version}</version>
            </dependency>

            <!--JWT(Json Web Token)登录支持-->
            <dependency>
                <groupId>com.nimbusds</groupId>
                <artifactId>nimbus-jose-jwt</artifactId>
                <version>${nimbus-jose-jwt.version}</version>
            </dependency>

            <!-- 防止跳过网关私自访问子服务，jwt代替uuid -->
            <dependency>
                <groupId>com.auth0</groupId>
                <artifactId>java-jwt</artifactId>
                <version>${java-jwt.version}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-commons</artifactId>
                <version>${spring-data-commons.version}</version>
            </dependency>

            <!-- JSON序列化/反序列化工具 -->
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>${jackson-databind.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson-databind.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>${jackson-databind.version}</version>
            </dependency>

            <!-- Spring 的参数校验库 -->
            <dependency>
                <groupId>javax.validation</groupId>
                <artifactId>validation-api</artifactId>
                <version>${validation-api.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

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

    <!-- 打包(跳过docker)：mvn clean package -DskipDocker -->
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                </plugin>
                <plugin>
                    <groupId>com.spotify</groupId>
                    <artifactId>docker-maven-plugin</artifactId>
                    <version>${docker-maven-plugin.version}</version>
                    <configuration>
                        <forceTags>true</forceTags>
                        <imageTags>
                            <imageTag>latest</imageTag>
                        </imageTags>
                        <imageName>${registryUrl}/${harbor.folder}/${project.artifactId}</imageName>
                        <baseImage>${registryUrl}/java/prijava:latest</baseImage>
                        <workdir>/opt</workdir>
                        <rm>true</rm>
                        <runs>
                            <run>chmod -R 777 /wait-for-it.sh</run>
                        </runs>
                        <cmd>["java", "-version"]</cmd>
                        <useGitCommitId>false</useGitCommitId>
                        <resources>
                            <resource>
                                <targetPath>/</targetPath>
                                <directory>${project.build.directory}</directory>
                                <include>${project.build.finalName}.jar</include>
                            </resource>
                            <resource>
                                <targetPath>/</targetPath>
                                <!--suppress UnresolvedMavenProperty -->
                                <directory>${pom.parent.basedir}/document/docker</directory>
                                <include>wait-for-it.sh</include>
                            </resource>
                        </resources>
                        <pushImageTag>true</pushImageTag>
                        <retryPushCount>3</retryPushCount>
                        <retryPushTimeout>8</retryPushTimeout>
                        <serverId>${serverId}</serverId>
                    </configuration>
                    <executions>
                        <execution>
                            <id>build-image</id>
                            <phase>package</phase>
                            <goals>
                                <goal>build</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <finalName>app</finalName>
    </build>

</project>