<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>
    <groupId>com.ajaxjs</groupId>
    <artifactId>ajaxjs-parent</artifactId>
    <description>ajaxjs-parent</description>
    <name>ajaxjs-parent</name>
    <version>1.2</version>
    <packaging>pom</packaging>

    <!--Maven 的基本使用终结版 https://segmentfault.com/a/1190000020380580-->

    <!-- 模块都写在此处 -->
    <modules>
        <!-- <module>../ajaxjs-base</module> -->
        <!-- <module>../ajaxjs-cms</module> -->
        <!-- <module>../ajaxjs-web</module> -->
    </modules>

    <!-- Common Start -->
    <url>https://framework.ajaxjs.com</url>
    <inceptionYear>2013</inceptionYear>

    <organization>
        <name>AJAXJS</name>
        <url>https://framework.ajaxjs.com</url>
    </organization>

    <developers>
        <developer>
            <name>Frank Cheung</name>
            <email>frank@ajaxjs.com</email>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <scm>
        <url>https://gitee.com/sp42_admin/ajaxjs/tree/master/ajaxjs-base</url>
        <connection>scm:git:git@gitee.com:sp42_admin/ajaxjs.git</connection>
        <developerConnection>scm:git:git@gitee.com:sp42_admin/ajaxjs.git</developerConnection>
    </scm>

    <issueManagement>
        <url>https://gitee.com/sp42_admin/ajaxjs/issues</url>
    </issueManagement>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <!-- IDEA Maven 插件默认 Java 1.5 编译，这里强制声明一下 -->
        <java.version>1.8</java.version>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <!-- servlet3 不需要 web.xml 问题 -->
        <failOnMissingWebXml>false</failOnMissingWebXml>
    </properties>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <build>
        <!-- 指定源码所在的目录 -->
        <!-- <sourceDirectory>src/main</sourceDirectory> -->
        <!-- 指定单元测试代码所在的目录 -->
        <!-- <testSourceDirectory>src/test</testSourceDirectory> -->

        <!-- 这两个目录中的文件也会分别被复制到 target/classes 和 target/test-classes 目录中。 -->
        <!-- <resources> -->
        <!-- <resource> -->
        <!-- <directory>src/main</directory> -->
        <!-- <excludes> -->
        <!-- <exclude>**/*.java</exclude> 排除 Java 文件 -->
        <!-- </excludes> -->
        <!-- </resource> -->
        <!-- </resources> -->
        <!-- <testResources> -->
        <!-- <testResource> -->
        <!-- <directory>src/test</directory> -->
        <!-- <excludes> -->
        <!-- <exclude>**/*.java</exclude> -->
        <!-- </excludes> -->
        <!-- </testResource> -->
        <!-- </testResources> -->

        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>

            <!-- 发布到中央库 -->
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.8</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>

            <!-- 加密签名 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.5</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- 打包带上 Java 源码 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- 生成 javadoc 文档 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9.1</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>

                        <configuration> <!-- add this to disable checking -->
                            <additionalparam>-Xdoclint:none</additionalparam>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- 打包时跳过测试 -->
<!--            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M5</version>
                <configuration>
                    <skipTests>true</skipTests>
                </configuration>
            </plugin>-->
        </plugins>
    </build>

    <!-- 公共依赖 -->
    <dependencies>
        <!-- 单元测试 -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>

        <!-- 模拟对象 -->
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>2.0.2-beta</version>
            <scope>test</scope>
        </dependency>

        <!-- 测试用的数据库驱动 -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.30</version>
            <scope>test</scope>
        </dependency>

        <!-- SQLite -->
        <dependency>
            <groupId>org.xerial</groupId>
            <artifactId>sqlite-jdbc</artifactId>
            <version>3.15.1</version>
            <scope>test</scope>
        </dependency>

        <!-- 编译为 jar 包时依赖的 -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>javax.servlet.jsp-api</artifactId>
            <version>2.2.1</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.websocket</groupId>
            <artifactId>javax.websocket-api</artifactId>
            <version>1.1</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
</project>