<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2020 coodex.org (jujus.shen@126.com)
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<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>org.coodex</groupId>
    <artifactId>coodex-libraries</artifactId>
    <version>0.5.0-RC2</version>
    <packaging>pom</packaging>
    <name>coodex-libraries</name>
    <description>coodex-libraries</description>
    <url>https://docs.coodex.org/lib/</url>

    <scm>
        <connection>scm:git:https://github.com/coodex2016/coodex-libraries.git</connection>
        <developerConnection>scm:git:https://github.com/coodex2016/coodex-libraries.git</developerConnection>
        <url>https://github.com/coodex2016/coodex-libraries.git</url>
    </scm>

    <licenses>
        <license>
            <name>Apache Licence 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>shenhainan</id>
            <name>Shen Hainan</name>
            <url>https://coodex.org</url>
            <email>jujus.shen@126.com</email>
            <organization>coodex.org</organization>
            <organizationUrl>https://coodex.org</organizationUrl>
        </developer>
    </developers>

    <properties>
        <encoding>UTF-8</encoding>
        <project.build.sourceEncoding>${encoding}</project.build.sourceEncoding>
        <project.reporting.outputEncoding>${encoding}</project.reporting.outputEncoding>
        <project.resources.sourceEncoding>${encoding}</project.resources.sourceEncoding>
        <archetype.encoding>${encoding}</archetype.encoding>

        <junit.version>4.13.1</junit.version>
        <jedis.version>3.2.0</jedis.version>
        <xmemcached.version>2.4.6</xmemcached.version>
        <lombok.version>1.18.18</lombok.version>
        <jts.version>1.18.1</jts.version>
        <fastjson.version>1.2.75</fastjson.version>
        <slf4j.version>1.7.30</slf4j.version>
        <log4j2.version>2.13.0</log4j2.version>
        <snakeyaml.version>1.26</snakeyaml.version>
        <cglib.version>3.2.12</cglib.version>
        <freemarker.version>2.3.28</freemarker.version>

        <spring.framework.version>5.3.4</spring.framework.version>
    </properties>

    <profiles>
        <profile>
            <id>disable-javadoc-doclint</id>
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <properties>
                <additionalparam>-Xdoclint:none</additionalparam>
            </properties>
        </profile>

        <profile>
            <id>oss.distribution</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.1.1</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <additionalOptions>-html5</additionalOptions>
                            <additionalOptions>-Xdoclint:none</additionalOptions>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

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

            <distributionManagement>
                <!-- oss -->
                <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>

        <profile>
            <id>local.release</id>
            <distributionManagement>
                <repository>
                    <id>local.distribution</id>
                    <!--suppress UnresolvedMavenProperty -->
                    <url>file:${local.distribution.path}</url>
                </repository>
            </distributionManagement>
        </profile>
        <profile>
            <id>coodex.release</id>
            <distributionManagement>
                <snapshotRepository>
                    <id>coodex.release</id>
                    <!--suppress UnresolvedMavenProperty -->
                    <url>${coodex.url.snapshot}</url>
                </snapshotRepository>
                <repository>
                    <id>coodex.release</id>
                    <!--suppress UnresolvedMavenProperty -->
                    <url>${coodex.url.release}</url>
                </repository>
            </distributionManagement>
        </profile>
    </profiles>

    <build>
        <!--        <pluginManagement>-->
        <!--            <plugins>-->
        <!--                <plugin>-->
        <!--                    <groupId>org.sonarsource.scanner.maven</groupId>-->
        <!--                    <artifactId>sonar-maven-plugin</artifactId>-->
        <!--                    <version>3.7.0.1746</version>-->
        <!--                </plugin>-->
        <!--            </plugins>-->
        <!--        </pluginManagement>-->

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>


            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <compilerArgs>
                        <arg>-Xlint:unchecked</arg>
                        <arg>-Xlint:rawtypes</arg>
                        <arg>-parameters</arg>
                    </compilerArgs>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>2.7</version>
            </plugin>

        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-framework-bom</artifactId>
                <version>${spring.framework.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${lombok.version}</version>
            </dependency>

            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>fastjson</artifactId>
                <version>${fastjson.version}</version>
            </dependency>

            <!-- slf4j -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>

            <!-- log4j 2 -->
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-bom</artifactId>
                <version>${log4j2.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- freemarker -->
            <dependency>
                <groupId>org.freemarker</groupId>
                <artifactId>freemarker</artifactId>
                <version>${freemarker.version}</version>
            </dependency>


            <!-- jUnit -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
            </dependency>

            <dependency>
                <groupId>cglib</groupId>
                <artifactId>cglib</artifactId>
                <version>${cglib.version}</version>
            </dependency>

            <dependency>
                <groupId>redis.clients</groupId>
                <artifactId>jedis</artifactId>
                <version>${jedis.version}</version>
            </dependency>

            <dependency>
                <groupId>com.googlecode.xmemcached</groupId>
                <artifactId>xmemcached</artifactId>
                <version>${xmemcached.version}</version>
            </dependency>

            <dependency>
                <groupId>org.yaml</groupId>
                <artifactId>snakeyaml</artifactId>
                <version>${snakeyaml.version}</version>
            </dependency>

            <!-- jts -->
            <dependency>
                <groupId>org.locationtech.jts</groupId>
                <artifactId>jts-core</artifactId>
                <version>${jts.version}</version>
            </dependency>

        </dependencies>

    </dependencyManagement>

    <modules>
        <module>coodex-bom</module>

        <module>coodex-utilities</module>
        <module>coodex-utilities-servlet</module>

        <module>coodex-mock-spec</module>
        <module>coodex-mock-impl</module>

        <module>coodex-billing</module>

        <module>coodex-jts-util</module>
        <module>coodex-junit-enhance</module>

        <module>shared-cache</module>
        <module>shared-cache-jedis</module>
        <module>shared-cache-memcached</module>
        <module>coodex-metadata</module>
        <module>coodex-renderer-freemarker</module>

    </modules>


</project>