<?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>
        <groupId>com.persagy</groupId>
        <artifactId>dmp</artifactId>
        <version>4.0.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>dmp-dic</artifactId>

    <dependencies>
        <dependency>
            <groupId>com.persagy</groupId>
            <artifactId>dmp-model</artifactId>
            <version>4.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.persagy</groupId>
            <artifactId>dmp-common</artifactId>
            <version>4.0.0</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid</artifactId>
            <version>1.1.21</version>
        </dependency>
        <dependency>
            <groupId>com.querydsl</groupId>
            <artifactId>querydsl-apt</artifactId>
        </dependency>
        <dependency>
            <groupId>com.querydsl</groupId>
            <artifactId>querydsl-sql</artifactId>
        </dependency>
        <dependency>
            <groupId>com.querydsl</groupId>
            <artifactId>querydsl-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>

        <!-- 注册中心 -->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
        </dependency>

        <!-- 配置中心 -->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
        </dependency>

        <!-- rabbitmq -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-amqp</artifactId>
        </dependency>
    </dependencies>

    <build>
        <finalName>dmp-dic</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <fork>true</fork>
                    <jvmArguments>-Dfile.encoding=UTF-8</jvmArguments>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.mysema.maven</groupId>
                <artifactId>apt-maven-plugin</artifactId>
                <version>1.1.3</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>target/generated-sources</outputDirectory>
                            <processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- 按照测试要求打成zip需要的配置 -->
<!--            &lt;!&ndash;获取git信息&ndash;&gt;-->
<!--            <plugin>-->
<!--                <groupId>pl.project13.maven</groupId>-->
<!--                <artifactId>git-commit-id-plugin</artifactId>-->
<!--                <executions>-->
<!--                    <execution>-->
<!--                        <goals>-->
<!--                            <goal>revision</goal>-->
<!--                        </goals>-->
<!--                    </execution>-->
<!--                </executions>-->
<!--                <configuration>-->
<!--                    <verbose>true</verbose>-->
<!--                    <dateFormat>yyyyMMddHHmm</dateFormat>-->
<!--                    <generateGitPropertiesFile>true</generateGitPropertiesFile>-->
<!--                    &lt;!&ndash;<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>&ndash;&gt;-->
<!--                    <generateGitPropertiesFilename>target/git.properties</generateGitPropertiesFilename>-->
<!--                </configuration>-->
<!--            </plugin>-->
            <plugin>
                <groupId>com.coderplus.maven.plugins</groupId>
                <artifactId>copy-rename-maven-plugin</artifactId>
                <version>1.0.1</version>
                <executions>
                    <execution>
                        <id>rename-file</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>rename</goal>
                        </goals>
                        <configuration>
<!--                            <sourceFile>${project.build.directory}/git.properties</sourceFile>-->
                            <destinationFile>${project.build.directory}/version.txt</destinationFile>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!--拷贝资源文件 copy-resources-->
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-resources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>src/main/resources/</directory>
                                    <includes>
                                        <include>**/*.yml</include>
                                    </includes>
                                </resource>
                                <resource>
                                    <directory>${project.build.directory}</directory>
                                    <includes>
                                        <include>**/version.txt</include>
                                    </includes>
                                </resource>
                            </resources>
                            <outputDirectory>${project.build.directory}/config</outputDirectory>
                        </configuration>
                    </execution>
                    <!--拷贝启动脚本-->
                    <execution>
                        <id>copy-version</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>src/script</directory>
                                </resource>
                            </resources>
                            <outputDirectory>${project.build.directory}</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

<!--            &lt;!&ndash; 打包压缩 &ndash;&gt;-->
<!--            <plugin>-->
<!--                <groupId>org.apache.maven.plugins</groupId>-->
<!--                <artifactId>maven-assembly-plugin</artifactId>-->
<!--                <executions>-->
<!--                    <execution>-->
<!--                        <id>make-assembly</id>-->
<!--                        &lt;!&ndash; 当执行mvn package时才会打包 &ndash;&gt;-->
<!--                        <phase>package</phase>-->
<!--                        <goals>-->
<!--                            <goal>single</goal>-->
<!--                        </goals>-->
<!--                        <configuration>-->
<!--                            <finalName>-->
<!--                                ${project.artifactId}_${git.commit.time}_git_${git.branch}_${git.commit.id.abbrev}-->
<!--                            </finalName>-->
<!--                            &lt;!&ndash;不包含assembly id&ndash;&gt;-->
<!--                            <appendAssemblyId>false</appendAssemblyId>-->
<!--                            &lt;!&ndash;输出路径&ndash;&gt;-->
<!--                            &lt;!&ndash;<outputDirectory>../target/co_search-${project.version}</outputDirectory>&ndash;&gt;-->
<!--                            <descriptors>-->
<!--                                <descriptor>src/script/zip.xml</descriptor>-->
<!--                            </descriptors>-->
<!--                        </configuration>-->
<!--                    </execution>-->
<!--                </executions>-->
<!--            </plugin>-->
        </plugins>
    </build>

</project>