<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.jimmoores</groupId>
    <artifactId>quandl</artifactId>
    <version>2.0.0</version>
    <packaging>pom</packaging>

    <modules>
        <module>core</module>
        <module>tablesaw</module>
    </modules>

    <name>Quandl4J</name>
    <description>Quandl REST API wrapper for Java</description>
    <url>http://quandl4j.org</url>

    <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>

    <developers>
        <developer>
            <id>jimmoores</id>
            <name>Jim Moores</name>
            <email>jim.moores@gmail.com</email>
            <url>http://github.com/jimmoores</url>
            <timezone>0</timezone>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/jimmoores/quandl4j</connection>
        <developerConnection>scm:git:git://github.com/jimmoores/quandl4j</developerConnection>
        <url>http://github.com/jimmoores/quandl4j</url>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <!-- Properties for maven-javadoc-plugin -->
        <windowtitle>Quandl4J API</windowtitle>
        <doctitle><![CDATA[<h1>Quandl Java Client API</h1>]]></doctitle>
        <bottom><![CDATA[<i>Copyright 2014-Present by Jim Moores</i><br /><i>${javadoc.footer.license}</i>]]></bottom>
        <!-- Properties for buildnumber-maven-plugin -->
        <maven.buildNumber.getRevisionOnlyOnce>true</maven.buildNumber.getRevisionOnlyOnce>
        <!-- Version properties -->
        <joda-beans.version>0.7.1</joda-beans.version>
        <jacoco-maven-plugin.version>0.6.3.201306030806</jacoco-maven-plugin.version>
        <jersey.version>1.17.1</jersey.version>
        <!-- Testing properties -->
        <tests.testng.maxheap>1G</tests.testng.maxheap>
        <tests.testng.logback>com/jimmoores/quandl/util/warn-logback.xml</tests.testng.logback>
        <tests.testng.parallel>classes</tests.testng.parallel>
        <tests.testng.threads>1</tests.testng.threads>
        <tests.testng.includedgroups>unit</tests.testng.includedgroups>
        <tests.testng.excludedgroups>integration,unitslow</tests.testng.excludedgroups>
        <maven-compiler-plugin.version>3.1</maven-compiler-plugin.version>
        <maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>
        <!--maven.compiler.source>1.7</maven.compiler.source -->
        <maven.compiler.target>1.7</maven.compiler.target>
        <gpg.skip>false</gpg.skip>
    </properties>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <build>
        <plugins>
            <!-- plug-in for staging to Nexus -->
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.2</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.5</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- setup testing -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.17</version>
                <configuration>
                    <includes>
                        <include>**/*Tests.java</include>
                    </includes>
                    <argLine>-Xmx${tests.testng.maxheap}</argLine>
                    <systemPropertyVariables>
                        <logback.configurationFile>${tests.testng.logback}</logback.configurationFile>
                        <test.database.type>hsqldb</test.database.type>
                    </systemPropertyVariables>
                    <parallel>${tests.testng.parallel}</parallel>
                    <threadCount>${tests.testng.threads}</threadCount>
                    <groups>${tests.testng.includedgroups}</groups>
                    <excludedGroups>${tests.testng.excludedgroups}</excludedGroups>
                    <!-- remove slow SuiteHTMLReporter -->
                    <properties>
                        <property>
                            <name>usedefaultlisteners</name>
                            <value>false</value>
                        </property>
                        <property>
                            <name>listener</name>
                            <value>org.testng.reporters.ExitCodeListener</value>
                        </property>
                        <property>
                            <name>reporter</name>
                            <value>org.testng.reporters.FailedReporter,org.testng.reporters.XMLReporter,org.testng.reporters.JUnitReportReporter</value>
                        </property>
                    </properties>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.8</version>
            </plugin>
            <!-- obtain git commit -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <version>1.2</version>
                <executions>
                    <execution>
                        <id>buildnumber</id>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <getRevisionOnlyOnce>${maven.buildNumber.getRevisionOnlyOnce}</getRevisionOnlyOnce>
                    <revisionOnScmFailure>UNKNOWN</revisionOnScmFailure>
                </configuration>
            </plugin>
            <!-- create and publish test jar files -->
            <!-- include build number in jar files -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <id>default-jar</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>test-jar</id>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <excludes>
                        <exclude>tests.properties</exclude>
                    </excludes>
                    <skipIfEmpty>true</skipIfEmpty>
                    <archive>
                        <manifestEntries>
                            <Implementation-Build>${buildNumber}</Implementation-Build>
                            <Implementation-Date>${maven.build.timestamp}</Implementation-Date>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <!-- generate source jar file when packaging -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                        <configuration>
                            <skipIfEmpty>true</skipIfEmpty>
                            <archive>
                                <manifest>
                                    <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                                    <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                                </manifest>
                                <manifestEntries>
                                    <Implementation-Build>${buildNumber}</Implementation-Build>
                                    <Implementation-Date>${maven.build.timestamp}</Implementation-Date>
                                </manifestEntries>
                            </archive>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- generate javadocs jar when packaging -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9.1</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- run checkstyle in the main build -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.12.1</version>
            </plugin>
            <!-- attach site -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.3</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>attach-descriptor</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <profiles>
        <!-- apply strict build rules, activated with -Dstrict -->
        <profile>
            <id>strict</id>
            <activation>
                <property>
                    <name>strict</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>enforce</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <!-- no commons-logging or good/evil 
                                            licensed json, junit only in test/provided -->
                                        <bannedDependencies>
                                            <excludes>
                                                <exclude>commons-logging:*</exclude>
                                                <exclude>org.json:json</exclude>
                                                <exclude>junit:*</exclude>
                                            </excludes>
                                            <includes>
                                                <include>junit:*:*:*:test</include>
                                                <include>junit:*:*:*:provided</include>
                                            </includes>
                                        </bannedDependencies>
                                        <banDuplicateClasses>
                                            <ignoreClasses>
                                                <ignoreClass>org.apache.commons.collections.ArrayStack</ignoreClass>
                                                <ignoreClass>org.apache.commons.collections.Buffer</ignoreClass>
                                                <ignoreClass>org.apache.commons.collections.BufferUnderflowException</ignoreClass>
                                                <ignoreClass>org.apache.commons.collections.FastHashMap*</ignoreClass>
                                                <ignoreClass>org.apache.tools.ant.ExitException</ignoreClass>
                                            </ignoreClasses>
                                            <findAllDuplicates>true</findAllDuplicates>
                                        </banDuplicateClasses>
                                        <!-- ensure dependencies resolve 
                                            to latest version (removed as randomly fails MENFORCER-134) -->
                                        <!--requireUpperBoundDeps / -->
                                        <!-- need Java 7 or greater -->
                                        <requireJavaVersion>
                                            <version>[1.7,)</version>
                                        </requireJavaVersion>
                                        <requirePluginVersions>
                                        </requirePluginVersions>
                                    </rules>
                                    <fail>true</fail>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>org.codehaus.mojo</groupId>
                                <artifactId>extra-enforcer-rules</artifactId>
                                <version>1.0-alpha-5</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <!-- validate no checkstyle violations -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>enforce-checkstyle</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                                <configuration>
                                    <logViolationsToConsole>true</logViolationsToConsole>
                                    <failOnViolation>true</failOnViolation>
                                    <violationSeverity>error</violationSeverity>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <!-- src zip file, activated with -Ddist-src -->
        <profile>
            <id>dist-src</id>
            <activation>
                <property>
                    <name>dist-src</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <inherited>false</inherited>
                        <executions>
                            <execution>
                                <id>src</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <target>
                                        <ant antfile="${basedir}/pom-ant.xml"
                                            target="dist-src" />
                                    </target>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <!-- setup to run all tests, activated with -Dall-tests -->
        <profile>
            <id>all-tests</id>
            <activation>
                <property>
                    <name>all-tests</name>
                </property>
            </activation>
            <properties>
                <tests.testng.includedgroups>unit,unitdb,unitslow</tests.testng.includedgroups>
                <tests.testng.excludedgroups>integration</tests.testng.excludedgroups>
            </properties>
        </profile>
        <!-- setup to run tests with code coverage, activated with -Dcoverage -->
        <profile>
            <id>coverage</id>
            <activation>
                <property>
                    <name>coverage</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>${jacoco-maven-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>prepare-agent</id>
                                <phase>process-sources</phase>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>report</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <argLine>-Xmx${tests.testng.maxheap}
                                ${argLine}</argLine>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <reporting>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>${jacoco-maven-plugin.version}</version>
                        <reportSets>
                            <reportSet>
                                <id>single</id>
                                <reports>
                                    <report>report</report>
                                </reports>
                            </reportSet>
                        </reportSets>
                    </plugin>
                </plugins>
            </reporting>
        </profile>
    </profiles>
</project>
