<?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>me.chyxion.tigon</groupId>
    <artifactId>tigon</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>pom</packaging>
    <name>Tigon</name>
    <description>Tigon</description>

    <parent>
        <groupId>me.chyxion</groupId>
        <artifactId>maven-parent</artifactId>
        <version>0.0.2-RELEASE</version>
    </parent>

    <properties>
        <maven.compiler.source>1.6</maven.compiler.source>
        <maven.compiler.target>1.6</maven.compiler.target>
        <spring.version>4.3.8.RELEASE</spring.version>
        <spring-boot.version>1.5.3.RELEASE</spring-boot.version>
        <slf4j.version>1.7.23</slf4j.version>
        <log4j.version>2.7</log4j.version>
        <shiro.version>1.3.2</shiro.version>
        <aspectj.version>1.8.10</aspectj.version>
        <main.class>Main</main.class>
        <maven.tomcat.port>8080</maven.tomcat.port>
        <maven.tomcat.path>/</maven.tomcat.path>
    </properties>

    <scm>
        <connection>scm:git:https://github.com/chyxion/tigon.git</connection>
        <developerConnection>scm:git:git@github.com:chyxion/tigon.git</developerConnection>
        <url>https://github.com/chyxion/tigon</url>
    </scm>

    <developers>
        <developer>
            <id>chyxion</id>
            <name>Shaun Chyxion</name>
            <email>chyxion@163.com</email>
            <url>http://chyxion.github.io</url>
        </developer>
    </developers>

    <modules>
        <!--<module>tigon-lombok</module>-->
        <module>tigon-model</module>
        <module>tigon-mybatis</module>
        <module>tigon-sequence</module>
        <module>tigon-redis</module>
        <module>tigon-mybatis-cache-redis</module>
        <module>tigon-shiro-cache</module>
        <module>tigon-shiro-cache-redis</module>
        <module>tigon-webmvc-core</module>
        <module>tigon-webmvc-spring-boot</module>
        <module>tigon-webmvc-war</module>
        <module>tigon-shiro-core</module>
        <module>tigon-shiro-spring-boot</module>
        <module>tigon-shiro-war</module>
        <module>tigon-service-api</module>
        <module>tigon-service-support</module>
        <module>tigon-props-config</module>
        <module>tigon-extjs</module>
        <module>tigon-freemarker-support</module>
        <module>tigon-jsp-support</module>
        <module>tigon-codegen</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>me.chyxion.tigon</groupId>
                <artifactId>tigon-lombok</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>me.chyxion.tigon</groupId>
                <artifactId>tigon-model</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>me.chyxion.tigon</groupId>
                <artifactId>tigon-mybatis</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>me.chyxion.tigon</groupId>
                <artifactId>tigon-sequence</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>me.chyxion.tigon</groupId>
                <artifactId>tigon-webmvc-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>me.chyxion.tigon</groupId>
                <artifactId>tigon-webmvc-spring-boot</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>me.chyxion.tigon</groupId>
                <artifactId>tigon-webmvc-war</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>me.chyxion.tigon</groupId>
                <artifactId>tigon-redis</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>me.chyxion.tigon</groupId>
                <artifactId>tigon-mybatis-cache-redis</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>me.chyxion.tigon</groupId>
                <artifactId>tigon-shiro-cache-redis</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>me.chyxion.tigon</groupId>
                <artifactId>tigon-shiro-cache</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>me.chyxion.tigon</groupId>
                <artifactId>tigon-shiro-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>me.chyxion.tigon</groupId>
                <artifactId>tigon-shiro-spring-boot</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>me.chyxion.tigon</groupId>
                <artifactId>tigon-shiro-war</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>me.chyxion.tigon</groupId>
                <artifactId>tigon-service-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>me.chyxion.tigon</groupId>
                <artifactId>tigon-service-support</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>me.chyxion.tigon</groupId>
                <artifactId>tigon-extjs</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>me.chyxion.tigon</groupId>
                <artifactId>tigon-freemarker-support</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>me.chyxion.tigon</groupId>
                <artifactId>tigon-jsp-support</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>me.chyxion.tigon</groupId>
                <artifactId>tigon-codegen</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>me.chyxion.tigon</groupId>
                <artifactId>tigon-props-config</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>1.16.14</version>
            </dependency>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-validator</artifactId>
                <version>5.4.0.Final</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils -->
            <dependency>
                <groupId>commons-beanutils</groupId>
                <artifactId>commons-beanutils</artifactId>
                <version>1.9.3</version>
            </dependency>
            <!-- mybatis -->
            <dependency>
                <groupId>org.mybatis</groupId>
                <artifactId>mybatis</artifactId>
                <version>3.4.2</version>
            </dependency>
            <dependency>
                <groupId>org.mybatis</groupId>
                <artifactId>mybatis-spring</artifactId>
                <version>1.3.1</version>
            </dependency>
            <!-- /mybatis -->
            <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
                <version>5.1.6</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>druid</artifactId>
                <version>1.0.28</version>
            </dependency>
            <dependency>
                <groupId>org.mongodb</groupId>
                <artifactId>bson</artifactId>
                <version>3.4.2</version>
            </dependency>
            <dependency>
                <groupId>redis.clients</groupId>
                <artifactId>jedis</artifactId>
                <version>2.9.0</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.shiro/shiro-core -->
            <dependency>
                <groupId>org.apache.shiro</groupId>
                <artifactId>shiro-core</artifactId>
                <version>${shiro.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.shiro</groupId>
                <artifactId>shiro-web</artifactId>
                <version>${shiro.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.shiro</groupId>
                <artifactId>shiro-spring</artifactId>
                <version>${shiro.version}</version>
            </dependency>
            <dependency>
                <artifactId>commons-fileupload</artifactId>
                <groupId>commons-fileupload</groupId>
                <version>1.3.2</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/cglib/cglib -->
            <dependency>
                <groupId>cglib</groupId>
                <artifactId>cglib</artifactId>
                <version>3.2.4</version>
            </dependency>
            <dependency>
                <groupId>org.aspectj</groupId>
                <artifactId>aspectjrt</artifactId>
                <version>${aspectj.version}</version>
            </dependency>
            <dependency>
                <groupId>org.aspectj</groupId>
                <artifactId>aspectjweaver</artifactId>
                <version>${aspectj.version}</version>
            </dependency>
            <!-- Spring Boot -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter</artifactId>
                <exclusions>
                    <exclusion>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-starter-logging</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <!-- / Spring Boot -->
            <dependency>
                <groupId>org.jdom</groupId>
                <artifactId>jdom</artifactId>
                <version>1.1.3</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>fastjson</artifactId>
                <version>1.2.31</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>3.1</version>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>2.4</version>
            </dependency>
            <dependency>
                <groupId>org.freemarker</groupId>
                <artifactId>freemarker</artifactId>
                <version>2.3.23</version>
            </dependency>
            <dependency>
                <artifactId>commons-codec</artifactId>
                <groupId>commons-codec</groupId>
                <version>1.10</version>
            </dependency>
            <dependency>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
                <version>1.2</version>
            </dependency>
            <!-- test -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.12</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>jcl-over-slf4j</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-api -->
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-api</artifactId>
                <version>${log4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-core</artifactId>
                <version>${log4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-slf4j-impl</artifactId>
                <version>${log4j.version}</version>
            </dependency>

            <!-- java web -->
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>javax.servlet-api</artifactId>
                <version>3.1.0</version>
            </dependency>
            <dependency>
                <groupId>javax.el</groupId>
                <artifactId>javax.el-api</artifactId>
                <version>3.0.0</version>
            </dependency>
            <dependency>
                <groupId>javax.servlet.jsp.jstl</groupId>
                <artifactId>jstl-api</artifactId>
                <version>1.2</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.coderplus.maven.plugins</groupId>
                <artifactId>copy-rename-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>cobertura-maven-plugin</artifactId>
                    <version>2.7</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.7</version>
                    <configuration>
                       <encoding>${project.build.sourceEncoding}</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.1</version>
                    <configuration>
                        <source>${maven.compiler.source}</source>
                        <target>${maven.compiler.target}</target>
                        <encoding>${project.build.sourceEncoding}</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>2.4</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>2.10</version>
                    <executions>
                        <execution>
                            <id>copy-dependencies</id>
                            <phase>package</phase>
                            <goals>
                                <goal>copy-dependencies</goal>
                            </goals>
                            <configuration>
                                <outputDirectory>
                                    target/lib
                                </outputDirectory>
                                <excludeScope>provided</excludeScope>
                                <includeScope>runtime</includeScope>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.6</version>
                    <configuration>
                        <archive>
                            <manifest>
                                <addClasspath>true</addClasspath>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                            </manifest>
                            <manifestEntries>
                                <Built-By>Shaun Chyxion</Built-By>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>2.3</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                            <configuration>
                                <finalName>${project.artifactId}</finalName>
                                <shadedArtifactAttached>true</shadedArtifactAttached>
                                <shadedClassifierName>jar-with-dependencies</shadedClassifierName>
                                <transformers>
                                    <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                        <mainClass>${main.class}</mainClass>
                                    </transformer>
                                    <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                        <resource>META-INF/spring.handlers</resource>
                                    </transformer>
                                    <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                        <resource>META-INF/spring.schemas</resource>
                                    </transformer>
                                    <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                        <resource>META-INF/spring.tooling</resource>
                                    </transformer>
                                </transformers>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>2.6.1</version>
                    <executions>
                        <execution>
                            <id>remove-config-file</id>
                            <goals><goal>clean</goal></goals>
                            <phase>compile</phase>
                            <configuration>
                                <excludeDefaultDirectories>true</excludeDefaultDirectories>
                                <filesets>
                                    <fileset>
                                        <directory>src/main/resources/spring</directory>
                                        <includes>
                                            <include>config.properties</include>
                                        </includes>
                                    </fileset>
                                    <fileset>
                                        <directory>src/main/resources</directory>
                                        <includes>
                                            <include>application.properties</include>
                                            <include>application.yaml</include>
                                            <include>log4j2.xml</include>
                                        </includes>
                                    </fileset>
                                </filesets>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>com.coderplus.maven.plugins</groupId>
                    <artifactId>copy-rename-maven-plugin</artifactId>
                    <version>1.0</version>
                    <executions>
                        <execution>
                            <id>copy-config-props-file</id>
                            <phase>generate-resources</phase>
                            <goals>
                                <goal>copy</goal>
                            </goals>
                            <configuration>
                                <sourceFile>src/main/resources/config_${project.activeProfiles[0].id}.properties</sourceFile>
                                <destinationFile>src/main/resources/spring/config.properties</destinationFile>
                            </configuration>
                        </execution>
                        <execution>
                            <id>copy-application-props-file</id>
                            <phase>generate-resources</phase>
                            <goals>
                                <goal>copy</goal>
                            </goals>
                            <configuration>
                                <sourceFile>src/main/resources/application_${project.activeProfiles[0].id}.properties</sourceFile>
                                <destinationFile>src/main/resources/application.properties</destinationFile>
                            </configuration>
                        </execution>
                        <execution>
                            <id>copy-application-yaml-file</id>
                            <phase>generate-resources</phase>
                            <goals>
                                <goal>copy</goal>
                            </goals>
                            <configuration>
                                <sourceFile>src/main/resources/application_${project.activeProfiles[0].id}.yaml</sourceFile>
                                <destinationFile>src/main/resources/application.yaml</destinationFile>
                            </configuration>
                        </execution>
                        <execution>
                            <id>copy-log4j2-xml-file</id>
                            <phase>generate-resources</phase>
                            <goals>
                                <goal>copy</goal>
                            </goals>
                            <configuration>
                                <sourceFile>src/main/resources/log4j2_${project.activeProfiles[0].id}.xml</sourceFile>
                                <destinationFile>src/main/resources/log4j2.xml</destinationFile>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.6</version>
                    <configuration>
                        <version>3.0</version>
                        <webResources>
                            <resource>
                                <directory>src/main/webapp</directory>
                            </resource>
                        </webResources>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.tomcat.maven</groupId>
                    <artifactId>tomcat7-maven-plugin</artifactId>
                    <version>2.2</version>
                    <configuration>
                        <port>${maven.tomcat.port}</port>
                        <path>${maven.tomcat.path}</path>
                        <charset>utf-8</charset>
                        <uriEncoding>utf-8</uriEncoding>
                        <contextReloadable>false</contextReloadable>
                        <systemProperties>
                            <http.port>${maven.tomcat.port}</http.port>
                            <project.basedir>${project.basedir}</project.basedir>
                        </systemProperties>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <version>${spring-boot.version}</version>
                    <configuration>
                        <addResources>true</addResources>
                        <mainClass>${start-class}</mainClass>
                        <layout>ZIP</layout>
                        <jvmArguments>
                            -Xdebug
                            -Dproject.basedir=${project.basedir}
                        </jvmArguments>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>repackage</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-help-plugin</artifactId>
                    <version>2.2</version>
                </plugin>
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.apache.maven.plugins</groupId>
                                        <artifactId>maven-clean-plugin</artifactId>
                                        <versionRange>
                                            [2.6.1,)
                                        </versionRange>
                                        <goals>
                                            <goal>clean</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>
