<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) 2013-2020 Vasilis Vryniotis <bbriniotis@datumbox.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>com.datumbox</groupId>
    <artifactId>datumbox-framework</artifactId>
    <version>0.8.2</version>
    <packaging>pom</packaging>
    
    <name>Datumbox Machine Learning Framework</name>
    <description>Datumbox is an open-source Machine Learning Framework written in Java which allows the rapid development of Machine Learning and Statistical applications.</description>
    <url>https://github.com/datumbox/datumbox-framework/</url>
    <organization>
    	<name>Datumbox</name>
    	<url>http://www.datumbox.com/</url>
    </organization>
    <inceptionYear>2013</inceptionYear>
    
    <developers>
        <developer>
            <id>bbriniotis</id>
            <name>Vasilis Vryniotis</name>
            <email>bbriniotis@datumbox.com</email>
            <url>http://blog.datumbox.com/author/bbriniotis/</url>
            <roles>
                <role>Project Lead Developer</role>
            </roles>
        </developer>
    </developers>
    
    <contributors>
        <contributor>
            <name>Eleftherios Bampaletakis</name>
            <email>lmpampaletakis@gmail.com</email>
            <url>http://gr.linkedin.com/pub/eleftherios-bampaletakis/39/875/551</url>
            <roles>
                <role>Java Consultant</role>
            </roles>
        </contributor>
    </contributors>
    
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>
    
    <issueManagement>
        <url>https://github.com/datumbox/datumbox-framework/issues/</url>
        <system>GitHub Issues</system>
    </issueManagement>
    
    <scm>
        <connection>scm:git:git@github.com:datumbox/datumbox-framework.git</connection>
        <url>scm:git:git@github.com:datumbox/datumbox-framework.git</url>
        <developerConnection>scm:git:git@github.com:datumbox/datumbox-framework.git</developerConnection>
    </scm>

    <repositories>
        <repository>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>central</id>
            <name>Central Repository</name>
            <url>https://repo.maven.apache.org/maven2</url>
        </repository>
    </repositories>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <properties>
        <!-- Build Plugins -->
        <java-version>11</java-version>
        <maven-compiler-plugin-version>3.8.1</maven-compiler-plugin-version>
        <maven-javadoc-plugin-version>3.2.0</maven-javadoc-plugin-version>
        <maven-source-plugin-version>3.2.0</maven-source-plugin-version>
        <maven-surefire-plugin-version>2.22.2</maven-surefire-plugin-version>
        <maven-jar-plugin-version>3.2.0</maven-jar-plugin-version>
        <gmaven-plugin-version>1.5</gmaven-plugin-version>
        <license-maven-plugin-version>3.0</license-maven-plugin-version>
        <nexus-staging-maven-plugin-version>1.6.8</nexus-staging-maven-plugin-version>
        <gpg-plugin-version>1.6</gpg-plugin-version>
        
        <!-- Code Dependencies -->
        <commons-math-version>3.6.1</commons-math-version>
        <commons-csv-version>1.8</commons-csv-version>
        <slf4j-api-version>1.7.30</slf4j-api-version>
        <libsvm-version>3.24</libsvm-version>
        <mapdb-version>1.0.9</mapdb-version>
        
        <!-- Test Dependencies -->
        <junit-version>4.13</junit-version>
        <logback-classic-version>1.2.3</logback-classic-version>
        
        <!-- Configuration -->
        <main.basedir>${project.basedir}</main.basedir>
        <gpg.keyname>7083A486</gpg.keyname>
        <buildNumber>${maven.build.timestamp}</buildNumber>
        <maven.build.timestamp.format>yyyyMMdd</maven.build.timestamp.format>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    </properties>

    <modules>
        <module>datumbox-framework-common</module>
        <module>datumbox-framework-tests</module>
        <module>datumbox-framework-storage</module>
        <module>datumbox-framework-core</module>
        <module>datumbox-framework-applications</module>
        <module>datumbox-framework-lib</module>
    </modules>
    
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin-version}</version>
                    <configuration>
                        <source>${java-version}</source>
                        <target>${java-version}</target>
                        <showDeprecation>true</showDeprecation>
                        <encoding>UTF-8</encoding>
                        <compilerArgs>
                            <!--
                            <arg>-verbose</arg>
                            <arg>-Xlint:all,-options,-path</arg>
                            -->
                        </compilerArgs>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-plugin-version}</version>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                            <configuration>
                                <additionalJOption>-Xdoclint:none</additionalJOption>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven-source-plugin-version}</version>
                    <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-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin-version}</version>
                    <configuration>
                        <threadCount>3</threadCount>
                        <parallel>all</parallel>
                        <argLine>-Xmx512M -Dfile.encoding=${project.build.sourceEncoding} -DskipAfterFailureCount=false</argLine>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven-jar-plugin-version}</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>test-jar</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <archive>
                            <manifest>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                                <addDefaultSpecificationEntries>false</addDefaultSpecificationEntries>
                                <addClasspath>true</addClasspath>
                                <classpathPrefix>lib/</classpathPrefix>
                                <mainClass>com.datumbox.framework.lib.Datumbox</mainClass>
                            </manifest>
                            <manifestEntries>
                                <Implementation-Author>${project.developers[0].name}</Implementation-Author>
                                <Implementation-Build>${buildNumber}</Implementation-Build>
                                <Implementation-Website>${project.organization.url}</Implementation-Website>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.gmaven</groupId>
                    <artifactId>gmaven-plugin</artifactId>
                    <version>${gmaven-plugin-version}</version>
                    <executions>
                        <execution>
                            <phase>validate</phase>
                            <goals>
                                <goal>execute</goal>
                            </goals>
                            <configuration>
                                <source>
                                    import java.util.Date
                                    import java.text.MessageFormat
                                    def vartimestamp = MessageFormat.format("{0,date,yyyy}", new Date())
                                    project.properties['currentYear'] = vartimestamp
                                </source>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>${license-maven-plugin-version}</version>
                    <configuration>
                        <header>${main.basedir}/datumbox-framework-common/src/main/resources/license.txt</header>
                        <properties>
                            <copyrightYears>${project.inceptionYear}-${currentYear}</copyrightYears>
                            <copyrightOwner>${project.developers[0].name}</copyrightOwner>
                            <copyrightEmail>${project.developers[0].email}</copyrightEmail>
                        </properties>
                        <excludes>
                            <exclude>CHANGELOG.md</exclude>
                            <exclude>LICENSE</exclude>
                            <exclude>NOTICE</exclude>
                            <exclude>README.md</exclude>
                            <exclude>TODO.txt</exclude>
                            <exclude>.travis.yml</exclude>
                            <exclude>appveyor.yml</exclude>
                            <exclude>.codeclimate.yml</exclude>
                            <exclude>**/license.txt</exclude>
                            <exclude>**/datasets/*</exclude>
                        </excludes>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>validate</phase>
                            <goals>
                                <goal>format</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>${nexus-staging-maven-plugin-version}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <serverId>ossrh</serverId>
                        <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                        <autoReleaseAfterClose>false</autoReleaseAfterClose>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <!-- Plugins which are always included -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-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-surefire-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.gmaven</groupId>
                <artifactId>gmaven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
            </plugin>
        </plugins>

    </build>

    <dependencyManagement>
        <dependencies>
            <!-- Main dependencies -->
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-math3</artifactId>
                <version>${commons-math-version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-csv</artifactId>
                <version>${commons-csv-version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j-api-version}</version>
            </dependency>
            <dependency>
                <groupId>tw.edu.ntu.csie</groupId>
                <artifactId>libsvm</artifactId>
                <version>${libsvm-version}</version>
            </dependency>
            <dependency>
                <groupId>org.mapdb</groupId>
                <artifactId>mapdb</artifactId>
                <version>${mapdb-version}</version>
            </dependency>

            <!-- Test dependencies -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit-version}</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${logback-classic-version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <profiles>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${gpg-plugin-version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
