<?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>kmall-pt</artifactId>
        <groupId>com.kmall</groupId>
        <version>3.1.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>kmall-schedule</artifactId>
    <packaging>war</packaging>
    <description>定时任务模块</description>

    <properties>
        <quartz-version>2.3.0</quartz-version>
    </properties>

    <dependencies>

        <dependency>
            <groupId>com.kmall</groupId>
            <artifactId>kmall-common</artifactId>
            <version>${kmall-version}</version>
        </dependency>
        <dependency>
            <groupId>com.kmall</groupId>
            <artifactId>kmall-manager</artifactId>
            <version>${kmall-version}</version>
        </dependency>

        <dependency>
            <groupId>org.quartz-scheduler</groupId>
            <artifactId>quartz</artifactId>
            <version>${quartz-version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>c3p0</artifactId>
                    <groupId>c3p0</groupId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>


    <!-- Build Settings -->
    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>**/*.xml</include>
                    <include>**/*.properties</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/java</directory>
                <filtering>true</filtering>
                <includes>
                    <include>**/*.xml</include>
                    <include>**/*.properties</include>
                </includes>
            </resource>
        </resources>

        <plugins>

            <!-- 拷贝依赖的jar包到lib目录 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-dependency</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
                            <excludeTransitive>false</excludeTransitive>
                            <stripVersion>false</stripVersion>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- 打包可执行jar -->
            <!-- 无依赖其他任何jar -->
            <!-- 打包jar文件时，配置manifest文件，加入lib包的jar依赖 -->
            <!--<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven.jar.version}</version>
                <configuration>
                    <archive>
                        <addMavenDescriptor>false</addMavenDescriptor>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <classpathPrefix>lib/</classpathPrefix>
                            <mainClass>com.kmall.schedule.Main</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>-->


            <!-- 打包war包 -->
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <version>${maven.war.version}</version>
                <configuration>
                    <packagingExcludes>WEB-INF/web.xml</packagingExcludes>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                    <warSourceDirectory>src/main/webapp</warSourceDirectory>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                    <webResources>
                        <resource>
                            <directory>src/main/resources/conf</directory>
                            <targetPath>WEB-INF/classes/conf</targetPath>
                            <filtering>true</filtering>
                        </resource>
                    </webResources>
                </configuration>
            </plugin>

        </plugins>

    </build>


</project>