<?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.d3xsystems</groupId>
    <artifactId>morpheus</artifactId>
    <version>1.0.3</version>
    <packaging>pom</packaging>

    <modules>
        <module>morpheus-core/pom.xml</module>
        <module>morpheus-viz/pom.xml</module>
        <module>morpheus-db/pom.xml</module>
        <module>morpheus-json/pom.xml</module>
        <module>morpheus-excel/pom.xml</module>
        <module>morpheus-quandl/pom.xml</module>
        <module>morpheus-worldbank/pom.xml</module>
        <module>morpheus-jblas/pom.xml</module>
        <!--module>morpheus-docs/pom.xml</module-->
    </modules>

    <name>morpheus</name>
    <description>A data science library for the JVM</description>
    <url>https://www.d3xsystems.com/morpheus</url>
    <inceptionYear>2014</inceptionYear>

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

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

    <scm>
        <url>https://github.com/d3xsystems/morpheus.git</url>
    </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>Apache License 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>

    <properties>
        <jdk.version>8</jdk.version>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>


    <dependencies>

        <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.16.22</version>
            <scope>provided</scope>
        </dependency>

    </dependencies>


    <profiles>

        <profile>

            <id>release</id>

            <build>

                <plugins>

                    <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-javadoc-plugin</artifactId>
                        <version>3.0.1</version>
                        <configuration>
                            <show>private</show>
                            <nohelp>true</nohelp>
                            <author>true</author>
                            <additionalOptions>-html5</additionalOptions>
                            <additionalOptions>-Xdoclint:none</additionalOptions>
                            <bottom>
                                <![CDATA[Copyright 2014-2018, <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>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <version>3.1.0</version>
                        <configuration>
                            <descriptors>
                                <descriptor>assembly.xml</descriptor>
                            </descriptors>
                        </configuration>
                        <executions>
                            <execution>
                                <id>create-archive</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>single</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-compiler-plugin</artifactId>
                    <version>3.8.0</version>
                    <configuration>
                        <release>${jdk.version}</release>
                        <fork>false</fork>
                        <showWarnings>true</showWarnings>
                        <debug>true</debug>
                        <debuglevel>lines,vars,source</debuglevel>
                        <optimize>true</optimize>
                        <showDeprecation>true</showDeprecation>
                    </configuration>

                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.1.0</version>
                    <configuration>
                        <archive>
                            <manifest>
                                <addClasspath>true</addClasspath>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                            </manifest>
                            <manifestEntries>
                                <Premain-Class>com.d3x.morpheus.util.Agent</Premain-Class>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.22.1</version>
                    <configuration>
                        <argLine>-Xmx4G</argLine>
                    </configuration>
                </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>

            </plugins>

        </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>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
            </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>
                <configuration>
                    <redirectTestOutputToFile>false</redirectTestOutputToFile>
                    <suiteXmlFiles>
                        <suiteXmlFile>testng.xml</suiteXmlFile>
                    </suiteXmlFiles>
                </configuration>
            </plugin>

        </plugins>

        <defaultGoal>clean install</defaultGoal>

    </build>

</project>