<?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">

    <groupId>com.github.knightliao.test</groupId>
    <artifactId>jutf-base</artifactId>
    <version>1.0.2</version>
    <packaging>pom</packaging>

    <modelVersion>4.0.0</modelVersion>

    <modules>
        <module>jutf</module>
        <module>jutf-spring</module>
    </modules>

    <properties>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <jmockit.version>1.24</jmockit.version>
        <spring.version>4.2.5.RELEASE</spring.version>
        <junit.version>4.12</junit.version>
        <commons-logging.version>1.1.3</commons-logging.version>
        <commons-lang3.version>3.4</commons-lang3.version>
        <log4j.version>1.2.17</log4j.version>
        <mockito.version>1.9.5</mockito.version>

        <mybatis-spring.version>1.2.2</mybatis-spring.version>
        <mybatis.version>3.3.0</mybatis.version>

        <!-- JAVA环境 -->
        <java.version>1.7</java.version>
        <source.version>1.7</source.version>
        <target.version>1.7</target.version>
    </properties>

    <!-- 构建 -->
    <build>
        <resources>
            <resource>
                <directory>${project.basedir}/src/main/java</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
            <resource>
                <directory>${project.basedir}/src/main/resources</directory>
                <includes>
                    <include>**/*.*</include>
                </includes>
            </resource>
        </resources>

        <finalName>jutf</finalName>

        <!-- 覆盖率 mvn test -->
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <formats>
                        <format>xml</format>
                        <format>html</format>
                    </formats>
                    <aggregate>true</aggregate>
                    <instrumentation>
                        <excludes>
                            <exclude>**/*Proto.class</exclude>
                            <exclude>**/*Proto$*.class</exclude>
                            <exclude>**/*Test.class</exclude>
                        </excludes>
                    </instrumentation>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>cobertura</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- 编译 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.1</version>
                <configuration>
                    <source>${source.version}</source>
                    <target>${target.version}</target>
                    <encoding>UTF-8</encoding>
                    <failOnError>true</failOnError>
                    <showDeprecation>true</showDeprecation>
                    <showWarnings>true</showWarnings>
                    <compilerArguments>
                        <verbose/>
                        <bootclasspath>${java.home}/lib/rt.jar</bootclasspath>
                    </compilerArguments>
                </configuration>

                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-compiler-javac</artifactId>
                        <version>1.8.1</version>
                    </dependency>
                </dependencies>
            </plugin>

            <!-- JAR包 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
            </plugin>

            <!-- auto deploy plugin -->
            <plugin>
                <groupId>org.codehaus.cargo</groupId>
                <artifactId>cargo-maven2-plugin</artifactId>
                <version>1.2.0</version>
            </plugin>

            <!-- 单测 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <argLine>-Dfile.encoding=UTF-8</argLine>
                    <includes>
                        <include>**/*TestCase.java</include>
                        <include>**/*Test.java</include>
                    </includes>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- 为了github的测试覆盖率 -->
            <plugin>
                <groupId>org.eluder.coveralls</groupId>
                <artifactId>coveralls-maven-plugin</artifactId>
                <version>3.1.0</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <tags>
                        <tag>
                            <name>date</name>
                            <!-- todo tag for all places -->
                            <placement>a</placement>
                            <head>date</head>
                        </tag>
                    </tags>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>

    <licenses>
        <license>
            <name>Apache 2</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Zhu Gongrui</name>
            <id>zhugongrui</id>
            <email>346996971@qq.com</email>
            <roles>
                <role>Developer</role>
            </roles>
            <timezone>+8</timezone>
        </developer>
        <developer>
            <name>Liao Qiqi</name>
            <id>knightliao</id>
            <email>knightliao@gmail.com</email>
            <roles>
                <role>Developer</role>
            </roles>
            <timezone>+8</timezone>
        </developer>
    </developers>

    <organization>
        <name>KNIGHT</name>
        <url>http://www.liaoqiqi.com</url>
    </organization>

    <scm>
        <url>scm:git:git@github.com:knightliao/jutf</url>
        <connection>scm:git:git@github.com:knightliao/jutf</connection>
        <tag>jutf</tag>
    </scm>

    <url>https://github.com/knightliao/jutf</url>
    <name>jutf</name>
    <description>jutf</description>

    <profiles>
        <profile>
            <id>release</id>
            <distributionManagement>
                <snapshotRepository>
                    <id>nexus-release</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
                </snapshotRepository>
                <repository>
                    <id>nexus-release</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
            <build>
                <plugins>
                    <!-- Source -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.2.1</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <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.10.4</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </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>
                </plugins>
            </build>
        </profile>
        <!-- 开发环境默认激活的profile -->
        <profile>
            <id>rd</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <resources>
                    <!-- 指定环境差异配置的配置文件所在目录 -->
                    <resource>
                        <directory>${basedir}/profile/rd</directory>
                    </resource>
                </resources>
            </build>
        </profile>
    </profiles>

</project>
