<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2020 the original author or authors.
  ~
  ~ Licensed under the LGPL, Version 3.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at  http://www.gnu.org/licenses/lgpl-3.0.html
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<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>sqlhelper-examples</artifactId>
        <groupId>com.github.fangjinuo.sqlhelper.examples</groupId>
        <version>3.0.5</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.github.fangjinuo.sqlhelper.examples</groupId>
    <artifactId>sqlhelper-examples-jfinal</artifactId>

    <dependencies>
        <dependency>
            <groupId>com.jfinal</groupId>
            <artifactId>jfinal</artifactId>
            <version>4.9</version>
        </dependency>
        <dependency>
            <groupId>com.jfinal</groupId>
            <artifactId>jfinal-undertow</artifactId>
            <version>2.1</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-nop</artifactId>
            <version>1.7.29</version>
            <!-- 打包前改成 provided，此处使用 compile 仅为支持 IDEA -->
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>

        <!-- mysql 驱动 -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.44</version>
        </dependency>

        <!-- druid 数据源连接池 -->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid</artifactId>
            <version>1.0.29</version>
        </dependency>

        <!-- cos 文件上传 -->
        <dependency>
            <groupId>com.jfinal</groupId>
            <artifactId>cos</artifactId>
            <version>2020.4</version>
        </dependency>

        <dependency>
            <groupId>com.github.fangjinuo.easyjson</groupId>
            <artifactId>easyjson-jackson</artifactId>
            <version>2.2.1</version>
        </dependency>

        <dependency>
            <groupId>com.github.fangjinuo.sqlhelper</groupId>
            <artifactId>sqlhelper-jfinal</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>com.github.fangjinuo.sqlhelper</groupId>
            <artifactId>sqlhelper-jsqlparser</artifactId>
            <version>${project.version}</version>
        </dependency>

    </dependencies>


    <build>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                    <!-- java8 保留参数名编译参数 -->
                    <compilerArgument>-parameters</compilerArgument>
                    <compilerArguments><verbose /></compilerArguments>
                </configuration>
            </plugin>

            <!--
                jar 包中的配置文件优先级高于 config 目录下的 "同名文件"
                因此，打包时需要排除掉 jar 包中来自 src/main/resources 目录的
                配置文件，否则部署时 config 目录中的同名配置文件不会生效
             -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <excludes>
                        <!-- **/* 前缀用法，可以匹配所有路径，例如：**/*.txt -->
                        <exclude>*.txt</exclude>
                        <exclude>*.xml</exclude>
                        <exclude>*.properties</exclude>
                    </excludes>
                </configuration>
            </plugin>

            <!--
                使用 mvn clean package 打包
                更多配置可参考官司方文档：http://maven.apache.org/plugins/maven-assembly-plugin/single-mojo.html
             -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>

                        <configuration>
                            <!-- 打包生成的文件名 -->
                            <finalName>${project.artifactId}</finalName>
                            <!-- jar 等压缩文件在被打包进入 zip、tar.gz 时是否压缩，设置为 false 可加快打包速度 -->
                            <recompressZippedFiles>false</recompressZippedFiles>
                            <!-- 打包生成的文件是否要追加 package.xml 中定义的 id 值 -->
                            <appendAssemblyId>true</appendAssemblyId>
                            <!-- 指向打包描述文件 package.xml -->
                            <descriptors>
                                <descriptor>package.xml</descriptor>
                            </descriptors>
                            <!-- 打包结果输出的基础目录 -->
                            <outputDirectory>${project.build.directory}/</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>

</project>