<?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">
    <modelVersion>4.0.0</modelVersion>

    <groupId>cn.qaiu</groupId>
    <artifactId>netdisk-fast-download</artifactId>
    <packaging>pom</packaging>
    <version>${revision}</version>

    <modules>
        <module>core</module>
        <module>web-service</module>
        <module>core-database</module>
        <module>parser</module>
    </modules>

    <properties>
        <revision>0.1.8</revision>
        <java.version>17</java.version>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <packageDirectory>${project.basedir}/web-service/target/package</packageDirectory>

        <vertx.version>4.5.22</vertx.version>
        <org.reflections.version>0.10.2</org.reflections.version>
        <lombok.version>1.18.38</lombok.version>
        <slf4j.version>2.0.5</slf4j.version>
        <commons-lang3.version>3.18.0</commons-lang3.version>
        <commons-beanutils2.version>2.0.0</commons-beanutils2.version>
        <jackson.version>2.14.2</jackson.version>
        <logback.version>1.5.19</logback.version>
        <junit.version>4.13.2</junit.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.vertx</groupId>
                <artifactId>vertx-dependencies</artifactId>
                <version>${vertx.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>cn.qaiu</groupId>
                <artifactId>core</artifactId>
                <version>${revision}</version>
            </dependency>

            <dependency>
                <groupId>cn.qaiu</groupId>
                <artifactId>core-database</artifactId>
                <version>${revision}</version>
            </dependency>
            <dependency>
                <groupId>cn.qaiu</groupId>
                <artifactId>parser</artifactId>
                <version>10.2.3</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.13.0</version>
                <configuration>
                    <release>${java.version}</release>
                </configuration>
            </plugin>

            <!-- 跳过测试类-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.2</version>
                <configuration>
                     <skipTests>true</skipTests>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>copy-static-web</id>
                        <phase>package</phase>
                        <goals>
                            <goal>resources</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>${project.basedir}/webroot</directory>
                                </resource>
                            </resources>
                            <outputDirectory>${packageDirectory}/webroot</outputDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-bin</id>
                        <phase>package</phase>
                        <goals>
                            <goal>resources</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>${project.basedir}/bin</directory>
                                </resource>
                            </resources>
                            <outputDirectory>${packageDirectory}</outputDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-db</id>
                        <phase>package</phase>
                        <goals>
                            <goal>resources</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>${project.basedir}/db</directory>
                                </resource>
                            </resources>
                            <outputDirectory>${packageDirectory}/db</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <!--<skip>true</skip>-->
                    <!--<failOnError>false</failOnError>-->
                    <!--当配置true时,只清理filesets里的文件,构建目录中得文件不被清理.默认是flase.-->
                    <excludeDefaultDirectories>false</excludeDefaultDirectories>

                </configuration>
            </plugin>
        </plugins>

    </build>
</project>
