<?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>com.github.ofofs</groupId>
    <artifactId>jca</artifactId>
    <packaging>pom</packaging>
    <version>1.0.2</version>

    <modules>
        <module>jca-core</module>
        <module>jca-test</module>
        <module>jca-api</module>
        <module>jca-unit</module>
    </modules>

    <name>Jca</name>
    <description>Java Compile Annotation</description>

    <url>https://github.com/ofofs/jca</url>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>ofofs</name>
            <email>ofofs@kangyonggan.com</email>
        </developer>
    </developers>
    <scm>
        <connection>scm:git:git@github.com/ofofs/jca.git</connection>
        <developerConnection>scm:git:git@github.com/ofofs/jca.git</developerConnection>
        <url>git@github.com/ofofs/jca.git</url>
    </scm>

    <properties>
        <!--Project-->
        <project.build.varsion>1.0.2</project.build.varsion>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <!--Plugin-->
        <plugin.compiler.version>3.5.1</plugin.compiler.version>
        <plugin.compiler.level>1.8</plugin.compiler.level>
        <plugin.source.version>2.2.1</plugin.source.version>
        <plugin.javadoc.version>2.9.1</plugin.javadoc.version>
        <plugin.gpg.version>1.6</plugin.gpg.version>
        <!--CI-->
        <plugin.coveralls.version>4.3.0</plugin.coveralls.version>
        <plugin.cobertura.version>2.7</plugin.cobertura.version>

        <!--Other-->
        <tools.version>1.5.0</tools.version>
        <fastjson.version>1.2.8</fastjson.version>
        <jcel.version>1.0</jcel.version>

        <!--Test-->
        <junit.version>5.2.0</junit.version>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <!--Compiler Plugin -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${plugin.compiler.version}</version>
                    <configuration>
                        <source>${plugin.compiler.level}</source>
                        <target>${plugin.compiler.level}</target>
                        <encoding>${project.build.sourceEncoding}</encoding>
                    </configuration>
                </plugin>

                <!--=================================== coveralls START ===================================-->
                <!--mvn cobertura:cobertura coveralls:report -DrepoToken=yourcoverallsprojectrepositorytoken-->
                <plugin>
                    <groupId>org.eluder.coveralls</groupId>
                    <artifactId>coveralls-maven-plugin</artifactId>
                    <version>${plugin.coveralls.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>cobertura-maven-plugin</artifactId>
                    <version>${plugin.cobertura.version}</version>
                    <configuration>
                        <format>xml</format>
                        <maxmem>256m</maxmem>
                        <!-- aggregated reports for multi-module projects -->
                        <aggregate>true</aggregate>
                        <instrumentation>
                            <excludes>
                                <exclude>**/*Test.class</exclude>
                                <!--<exclude>**/*Vo.class</exclude>-->
                            </excludes>
                        </instrumentation>
                    </configuration>
                </plugin>
                <!--=================================== coveralls END ===================================-->
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>

            <!--=================================== coveralls START ===================================-->
            <!--mvn cobertura:cobertura coveralls:report -DrepoToken=yourcoverallsprojectrepositorytoken-->
            <plugin>
                <groupId>org.eluder.coveralls</groupId>
                <artifactId>coveralls-maven-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
            </plugin>
            <!--=================================== coveralls END ===================================-->
        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>
            <!--Project-->
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>jca-api</artifactId>
                <version>${project.build.varsion}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>jca-core</artifactId>
                <version>${project.build.varsion}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>jca-unit</artifactId>
                <version>${project.build.varsion}</version>
            </dependency>

            <!--Other-->
            <dependency>
                <groupId>sun.jdk</groupId>
                <artifactId>tools</artifactId>
                <version>${tools.version}</version>
                <scope>system</scope>
                <systemPath>${java.home}/../lib/tools.jar</systemPath>
            </dependency>
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>fastjson</artifactId>
                <version>${fastjson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.kangyonggan</groupId>
                <artifactId>jcel</artifactId>
                <version>${jcel.version}</version>
            </dependency>

            <!--Test-->
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${junit.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!-- Source -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${plugin.source.version}</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>${plugin.javadoc.version}</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- GPG -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${plugin.gpg.version}</version>
                        <executions>
                            <execution>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>

            <distributionManagement>
                <snapshotRepository>
                    <id>oss</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
                </snapshotRepository>
                <repository>
                    <id>oss</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
        </profile>
    </profiles>
</project>