<?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.fireflysource</groupId>
    <artifactId>firefly-framework</artifactId>
    <version>5.0.0-dev2</version>
    <packaging>pom</packaging>


    <name>Firefly Framework</name>
    <description>
        Firefly framework helps you create a java web application easy and quickly. It provides MVC framework with HTTP
        Server and many other useful components for developing web applications. It means you can easy deploy your web
        without any other java web containers, in short , it's containerless. It taps into the fullest potential of
        hardware using SEDA architecture, a highly customizable thread model.
    </description>
    <url>http://www.fireflysource.com</url>
    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>Alvin Qiu</name>
            <email>qptkk@163.com</email>
            <organization>Fireflysource</organization>
            <organizationUrl>http://www.fireflysource.com</organizationUrl>
        </developer>
    </developers>
    <scm>
        <connection>scm:git@github.com:hypercube1024/firefly.git</connection>
        <developerConnection>scm:git@github.com:hypercube1024/firefly.git</developerConnection>
        <url>git@github.com:hypercube1024/firefly.git</url>
    </scm>

    <modules>
        <module>firefly-common</module>
        <module>firefly-nettool</module>
        <module>firefly-slf4j</module>
        <module>firefly-db</module>
        <module>firefly</module>
        <module>firefly-example</module>
        <module>firefly-kotlin-ext</module>
        <module>firefly-reactive</module>
        <module>firefly-session</module>
        <module>firefly-wechat</module>
        <module>firefly-boot</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <log.level>INFO</log.level>
        <log.path>../logs</log.path>

        <firefly.version>${project.version}</firefly.version>

        <!-- Kotlin compiler configuration -->
        <kotlin.version>1.3.10</kotlin.version>
        <kotlin.coroutine.version>1.0.1</kotlin.coroutine.version>
        <kotlin.compiler.incremental>false</kotlin.compiler.incremental>
        <kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
        <kotlin.compiler.languageVersion>1.3</kotlin.compiler.languageVersion>
        <kotlin.compiler.apiVersion>1.3</kotlin.compiler.apiVersion>
        <kotlin.code.style>official</kotlin.code.style>

        <!-- Kotlin doc configuration -->
        <dokka.version>0.9.17</dokka.version>
        <dokka.config.noStdlibLink>true</dokka.config.noStdlibLink>
        <dokka.config.jdkVersion>8</dokka.config.jdkVersion>

        <!-- The third party lib -->
        <metrics.version>4.0.3</metrics.version>
        <jackson.version>2.9.7</jackson.version>
        <msgpack.version>0.8.16</msgpack.version>
        <redisson.version>3.9.1</redisson.version>
        <conscrypt.version>1.4.1</conscrypt.version>
        <hikariCP.version>3.2.0</hikariCP.version>
        <spring.reactor.version>Californium-RELEASE</spring.reactor.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- firefly module -->
            <dependency>
                <groupId>com.fireflysource</groupId>
                <artifactId>firefly-db</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fireflysource</groupId>
                <artifactId>firefly-slf4j</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fireflysource</groupId>
                <artifactId>firefly-common</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fireflysource</groupId>
                <artifactId>firefly-nettool</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fireflysource</groupId>
                <artifactId>firefly</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fireflysource</groupId>
                <artifactId>firefly-kotlin-ext</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fireflysource</groupId>
                <artifactId>firefly-reactive</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fireflysource</groupId>
                <artifactId>firefly-session</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fireflysource</groupId>
                <artifactId>firefly-wechat</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fireflysource</groupId>
                <artifactId>firefly-boot</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- 3rd party lib -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>1.7.25</version>
            </dependency>
            <dependency>
                <groupId>org.javassist</groupId>
                <artifactId>javassist</artifactId>
                <version>3.23.1-GA</version>
            </dependency>

            <!-- reactor -->
            <dependency>
                <groupId>io.projectreactor</groupId>
                <artifactId>reactor-bom</artifactId>
                <version>${spring.reactor.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- metrics -->
            <dependency>
                <groupId>io.dropwizard.metrics</groupId>
                <artifactId>metrics-core</artifactId>
                <version>${metrics.version}</version>
            </dependency>
            <dependency>
                <groupId>io.dropwizard.metrics</groupId>
                <artifactId>metrics-healthchecks</artifactId>
                <version>${metrics.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.vladimir-bukhtoyarov</groupId>
                <artifactId>rolling-metrics</artifactId>
                <version>2.0.3</version>
            </dependency>
            <dependency>
                <groupId>org.hdrhistogram</groupId>
                <artifactId>HdrHistogram</artifactId>
                <version>2.1.10</version>
            </dependency>

            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>javax.servlet-api</artifactId>
                <version>3.1.0</version>
            </dependency>
            <dependency>
                <groupId>com.github.spullara.mustache.java</groupId>
                <artifactId>compiler</artifactId>
                <version>0.9.5</version>
            </dependency>

            <!-- db -->
            <dependency>
                <groupId>com.zaxxer</groupId>
                <artifactId>HikariCP</artifactId>
                <version>${hikariCP.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.h2database</groupId>
                <artifactId>h2</artifactId>
                <version>1.4.196</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>commons-dbutils</groupId>
                <artifactId>commons-dbutils</artifactId>
                <version>1.7</version>
            </dependency>
            <dependency>
                <groupId>org.redisson</groupId>
                <artifactId>redisson</artifactId>
                <version>${redisson.version}</version>
            </dependency>

            <!-- kotlin lib -->
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib-jdk8</artifactId>
                <version>${kotlin.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-reflect</artifactId>
                <version>${kotlin.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlinx</groupId>
                <artifactId>kotlinx-coroutines-core</artifactId>
                <version>${kotlin.coroutine.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlinx</groupId>
                <artifactId>kotlinx-coroutines-jdk8</artifactId>
                <version>${kotlin.coroutine.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlinx</groupId>
                <artifactId>kotlinx-coroutines-reactor</artifactId>
                <version>${kotlin.coroutine.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlinx</groupId>
                <artifactId>kotlinx-coroutines-nio</artifactId>
                <version>${kotlin.coroutine.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-test-junit</artifactId>
                <version>${kotlin.version}</version>
                <scope>test</scope>
            </dependency>

            <!-- junit -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.12</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-all</artifactId>
                <version>1.3</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>2.23.0</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.conscrypt</groupId>
                <artifactId>conscrypt-openjdk-uber</artifactId>
                <version>${conscrypt.version}</version>
            </dependency>

            <dependency>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcprov-jdk15on</artifactId>
                <version>1.59</version>
            </dependency>

            <!--jackson-->
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.dataformat</groupId>
                <artifactId>jackson-dataformat-yaml</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.dataformat</groupId>
                <artifactId>jackson-dataformat-xml</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.dataformat</groupId>
                <artifactId>jackson-dataformat-ion</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.dataformat</groupId>
                <artifactId>jackson-dataformat-protobuf</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>org.codehaus.woodstox</groupId>
                <artifactId>woodstox-core-asl</artifactId>
                <version>4.4.1</version>
            </dependency>
            <dependency>
                <groupId>org.msgpack</groupId>
                <artifactId>jackson-dataformat-msgpack</artifactId>
                <version>${msgpack.version}</version>
            </dependency>

            <dependency>
                <groupId>io.swagger.core.v3</groupId>
                <artifactId>swagger-models</artifactId>
                <version>2.0.2</version>
            </dependency>
            <dependency>
                <groupId>io.swagger</groupId>
                <artifactId>swagger-models</artifactId>
                <version>1.5.20</version>
            </dependency>

            <dependency>
                <groupId>io.protostuff</groupId>
                <artifactId>protostuff-bom</artifactId>
                <version>1.6.0</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>de.ruedigermoeller</groupId>
                <artifactId>fst</artifactId>
                <version>2.57</version>
            </dependency>

            <dependency>
                <groupId>org.webjars.npm</groupId>
                <artifactId>mdui</artifactId>
                <version>0.4.0</version>
            </dependency>

            <dependency>
                <groupId>com.beust</groupId>
                <artifactId>jcommander</artifactId>
                <version>1.72</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- junit -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>1.5</version>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.6.8</version>
                </plugin>

                <plugin>
                    <groupId>org.jetbrains.kotlin</groupId>
                    <artifactId>kotlin-maven-plugin</artifactId>
                    <version>${kotlin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.jetbrains.dokka</groupId>
                    <artifactId>dokka-maven-plugin</artifactId>
                    <version>${dokka.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.8.2</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.maven.reporting</groupId>
                            <artifactId>maven-reporting-api</artifactId>
                            <version>3.0</version>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.maven.reporting</groupId>
                            <artifactId>maven-reporting-impl</artifactId>
                            <version>3.0.0</version>
                        </dependency>
                    </dependencies>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.22.1</version>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>3.0.0</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.7</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.8</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>org.ow2.asm</groupId>
                        <artifactId>asm</artifactId>
                        <version>6.2.1</version>
                    </dependency>
                </dependencies>
            </plugin>

            <!-- compiler plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <compilerArgument>-parameters</compilerArgument>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>

            <!-- source -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.basedir}/src/main/java</source>
                                <source>${project.basedir}/src/main/kotlin</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>jdk_8</id>
            <activation>
                <jdk>[1.8, 10)</jdk>
            </activation>
            <build>
                <plugins>
                    <!-- javadoc -->
                    <plugin>
                        <groupId>org.jetbrains.dokka</groupId>
                        <artifactId>dokka-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>dokka</goal>
                                    <goal>javadoc</goal>
                                    <goal>javadocJar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <sourceDirectories>
                                <dir>${project.basedir}/src/main/java</dir>
                                <dir>${project.basedir}/src/main/kotlin</dir>
                            </sourceDirectories>
                            <sourceLinks>
                                <link>
                                    <dir>${project.basedir}/src/main/java</dir>
                                    <dir>${project.basedir}/src/main/kotlin</dir>
                                </link>
                            </sourceLinks>
                            <noStdlibLink>${dokka.config.noStdlibLink}</noStdlibLink>
                            <jdkVersion>${dokka.config.jdkVersion}</jdkVersion>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>jdk_11</id>
            <activation>
                <jdk>11</jdk>
            </activation>
            <build>
                <plugins>
                    <!-- javadoc -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <additionalJOption>-Xdoclint:none</additionalJOption>
                            <failOnError>true</failOnError>
                            <charset>UTF-8</charset>
                            <encoding>UTF-8</encoding>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.jetbrains.dokka</groupId>
                        <artifactId>dokka-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>dokka</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <sourceDirectories>
                                <dir>${project.basedir}/src/main/java</dir>
                                <dir>${project.basedir}/src/main/kotlin</dir>
                            </sourceDirectories>
                            <sourceLinks>
                                <link>
                                    <dir>${project.basedir}/src/main/java</dir>
                                    <dir>${project.basedir}/src/main/kotlin</dir>
                                </link>
                            </sourceLinks>
                            <noStdlibLink>${dokka.config.noStdlibLink}</noStdlibLink>
                            <jdkVersion>${dokka.config.jdkVersion}</jdkVersion>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!-- gpg -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- staging -->
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                            <stagingProgressTimeoutMinutes>30</stagingProgressTimeoutMinutes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>

            <distributionManagement>
                <snapshotRepository>
                    <id>sonatype_snapshots</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
                <repository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
        </profile>
    </profiles>

    <repositories>
        <repository>
            <id>central</id>
            <name>CentralRepository</name>
            <url>http://central.maven.org/maven2/</url>
        </repository>
        <repository>
            <id>jcentral</id>
            <name>JCenter</name>
            <url>http://jcenter.bintray.com</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>central</id>
            <name>CentralRepository</name>
            <url>http://central.maven.org/maven2/</url>
        </pluginRepository>
        <pluginRepository>
            <id>jcentral</id>
            <name>JCenter</name>
            <url>https://jcenter.bintray.com/</url>
        </pluginRepository>
    </pluginRepositories>
</project>
