<!--
  ~ Copyright (C) 2018-2019 D3X Systems - All Rights Reserved
  ~
  ~ 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>com.d3xsystems</groupId>
    <artifactId>d3x-core</artifactId>
    <version>1.0.77</version>
    <packaging>pom</packaging>

    <modules>
        <module>d3x-core-db/pom.xml</module>
        <module>d3x-core-util/pom.xml</module>
        <module>d3x-core-json/pom.xml</module>
        <module>d3x-core-account/pom.xml</module>
        <module>d3x-core-notify/pom.xml</module>
        <module>d3x-core-http-client/pom.xml</module>
        <module>d3x-core-http-server/pom.xml</module>
        <module>d3x-core-rest/pom.xml</module>
    </modules>

    <name>d3x-core</name>
    <description>A core java library from D3X systems</description>
    <url>https://www.d3xsystems.com</url>
    <inceptionYear>2018</inceptionYear>

    <developers>
        <developer>
            <id>zav@d3xsystems.com</id>
            <name>Xavier Witdouck</name>
            <email>zav@d3xsystems.com</email>
            <timezone>America/New_York</timezone>
        </developer>
    </developers>

    <organization>
        <name>D3X Systems</name>
        <url>https://www.dsxsystems.com</url>
    </organization>

    <scm>
        <url>https://github.com/d3xsystems/d3x-core.git</url>
        <connection>scm:git:https://github.com/d3xsystems/d3x-core.git</connection>
        <tag>HEAD</tag>
    </scm>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</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>

    <licenses>
        <license>
            <name>D3X Systems Software License</name>
            <url>https://www.d3xsystems.com/public/license.txt</url>
        </license>
    </licenses>

    <properties>
        <jdk.version>11</jdk.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.0.13</version>
        </dependency>

        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.13.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.8</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.unitils</groupId>
            <artifactId>unitils-core</artifactId>
            <version>3.4.2</version>
            <scope>test</scope>
        </dependency>

    </dependencies>


    <profiles>

        <profile>

            <id>release</id>

            <build>

                <plugins>

                    <plugin>
                        <groupId>org.projectlombok</groupId>
                        <artifactId>lombok-maven-plugin</artifactId>
                        <version>1.18.6.0</version>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.0.1</version>
                        <configuration>
                            <show>private</show>
                            <nohelp>true</nohelp>
                            <author>true</author>
                            <sourcepath>${project.build.directory}/generated-sources/delombok</sourcepath>
                            <additionalOptions>-html5</additionalOptions>
                            <additionalOptions>-Xdoclint:none</additionalOptions>
                            <bottom>
                                <![CDATA[Copyright 2014-2019, <a href="https://www.d3xsystems.com">D3X Systems<a>]]>
                            </bottom>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </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>
                            </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>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
                        </configuration>
                    </plugin>

                </plugins>

            </build>

        </profile>

    </profiles>


    <build>

        <pluginManagement>

            <plugins>

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

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.0.1</version>
                    <configuration>
                        <outputDirectory>${project.build.directory}</outputDirectory>
                        <finalName>${project.build.finalName}</finalName>
                        <attach>true</attach>
                    </configuration>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <phase>verify</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.0</version>
                    <configuration>
                        <fork>true</fork>
                        <source>${jdk.version}</source>
                        <target>${jdk.version}</target>
                        <showWarnings>true</showWarnings>
                        <debug>true</debug>
                        <debuglevel>lines,vars,source</debuglevel>
                        <optimize>true</optimize>
                        <showDeprecation>true</showDeprecation>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.projectlombok</groupId>
                    <artifactId>lombok-maven-plugin</artifactId>
                    <version>1.18.6.0</version>
                    <configuration>
                        <sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
                        <addOutputDirectory>false</addOutputDirectory>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>delombok</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>buildnumber-maven-plugin</artifactId>
                    <version>1.3</version>
                    <executions>
                        <execution>
                            <phase>validate</phase>
                            <goals>
                                <goal>create</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <doCheck>false</doCheck>
                        <doUpdate>false</doUpdate>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.1.0</version>
                    <configuration>
                        <archive>
                            <manifest>
                                <addClasspath>false</addClasspath>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                            </manifest>
                            <manifestEntries>
                                <Build-Time>${maven.build.timestamp}</Build-Time>
                                <Build-OS>${os.name} ${os.arch} ${os.version}</Build-OS>
                                <Build-JDK>${java.version} (${java.vendor} ${java.vm.version})</Build-JDK>
                                <GIT-Commit>${buildNumber}</GIT-Commit>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.22.1</version>
                    <configuration>
                        <redirectTestOutputToFile>false</redirectTestOutputToFile>
                        <!--suiteXmlFiles>
                          <suiteXmlFile>testng.xml</suiteXmlFile>
                        </suiteXmlFiles-->
                    </configuration>
                </plugin>

            </plugins>

        </pluginManagement>

        <plugins>

            <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-compiler-plugin</artifactId>
                <version>3.8.0</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <version>1.3</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-surefire-plugin</artifactId>
                <version>2.22.1</version>
            </plugin>

        </plugins>

        <defaultGoal>clean install</defaultGoal>

    </build>

</project>