<?xml version="1.0" encoding="UTF-8"?>
<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.franz</groupId>
  <artifactId>agraph-java-client</artifactId>
  <version>4.0.0</version>
  <name>agraph-java-client</name>
  <description>Java client API for Franz AllegroGraph</description>
  <url>https://github.com/franzinc/agraph-java-client</url>
  
  <licenses>
    <license>
      <name>Eclipse Public License 1.0</name>
      <url>http://opensource.org/licenses/eclipse-1.0.php</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <scm>
    <url>https://github.com/franzinc/agraph-java-client</url>
    <connection>scm:git:git://github.com/franzinc/agraph-java-client.git</connection>
    <developerConnection>scm:git:git@github.com:franzinc/agraph-java-client.git</developerConnection>
  </scm>

  <organization>
    <name>Franz Inc.</name>
    <url>http://franz.com/</url>
  </organization>

  <developers>
    <developer>
      <email>support@franz.com</email>
      <organization>Franz Inc.</organization>
      <organizationUrl>http://franz.com</organizationUrl>
    </developer>
  </developers>
  
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <tests.include>test.TestSuites$Prepush</tests.include>
    <tests.exclude />
    <!-- All RDF4J deps use the same version. -->
    <rdf4j.version>2.4.0</rdf4j.version>
    <!-- Same thing applies to Jena. -->
    <jena.version>3.3.0</jena.version>
  </properties>

  <!--Use a separate profile for release deployment. -->
  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <!-- Use GPG signatures when publishing.
               Credentials are configured in settings.xml. -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
	    <configuration>
	      <keyname>support@franz.com</keyname>
	    </configuration>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <build>
    <plugins>
      <!-- Get the current year. Just 17 lines of XML! -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
        <version>1.4</version>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>create-timestamp</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <timestampFormat>YYYY</timestampFormat>
          <timestampPropertyName>year</timestampPropertyName>
        </configuration>
      </plugin>

      <!-- Nexus staging and deployment. -->
      <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>
      
      <!-- Used by the deploy script to increment the version. -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.12</version>
        <executions>
          <!-- Extract first two components from the RDF4J version number.
               These are needed to construct Javadoc URLs. -->
          <execution>
            <id>regex-property</id>
            <goals>
              <goal>regex-property</goal>
            </goals>
            <configuration>
              <name>rdf4j.release</name>
              <value>${rdf4j.version}</value>
              <regex>([^.]*\.[^.])\..*</regex>
              <replacement>$1</replacement>
            </configuration>
          </execution>
        </executions>
      </plugin>
      
      <!-- Compiler settings. -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.5.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      
      <!-- Common test settings. -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.19.1</version>
        <configuration>
          <reportFormat>plain</reportFormat>
          <useFile>false</useFile>
          <excludes>
            <exclude>${tests.exclude}</exclude>
          </excludes>
          <includes>
            <include>${tests.include}</include>
          </includes>
          <systemPropertyVariables>
            <org.apache.commons.logging.Log>
              org.apache.commons.logging.impl.SimpleLog
            </org.apache.commons.logging.Log>
            <org.apache.commons.logging.Log>
              org.apache.commons.logging.impl.SimpleLog
            </org.apache.commons.logging.Log>
            <org.apache.commons.logging.simplelog.defaultlog>
              info
            </org.apache.commons.logging.simplelog.defaultlog>
            <org.apache.commons.logging.simplelog.log.org>
              info
            </org.apache.commons.logging.simplelog.log.org>
            <org.apache.commons.logging.simplelog.log.httpclient>
              info
            </org.apache.commons.logging.simplelog.log.httpclient>
            <org.apache.commons.logging.simplelog.showlogname>
              true
            </org.apache.commons.logging.simplelog.showlogname>
            <org.apache.commons.logging.simplelog.showdatetime>
              true
            </org.apache.commons.logging.simplelog.showdatetime>
            <AGRAPH_HOST>${env.AGRAPH_HOST}</AGRAPH_HOST>
            <AGRAPH_PORT>${env.AGRAPH_PORT}</AGRAPH_PORT>
            <AGRAPH_ROOT>${env.root}</AGRAPH_ROOT>
          </systemPropertyVariables>
        </configuration>
      </plugin>

      <!-- JAR configuration (manifest + meta-inf). -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.0.2</version>
        <configuration>
          <archive>
            <index>true</index>
            <manifest>
              <addClasspath>true</addClasspath>
            </manifest>
            <manifestEntries>
              <Implementation-Title>AllegroGraph Java Client</Implementation-Title>
              <Implementation-Version>${project.version}</Implementation-Version>
              <Implementation-Vendor>Franz, Inc.</Implementation-Vendor>
              <Implementation-URL>http://www.franz.com/agraph/</Implementation-URL>
              <Built-At>${maven.build.timestamp}</Built-At>
            </manifestEntries>
          </archive>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Source JAR -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.0.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Javadoc settings. -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.1.0</version>
        <configuration>
          <author>true</author>
          <destDir>doc</destDir>
          <doctitle>Franz, Inc. AllegroGraph Java Client ${project.version} Javadoc</doctitle>
          <footer>Copyright &amp;copy; 2008-${year} Franz Inc.</footer>
          <header>Franz Inc, AllegroGraph Java Client</header>
          <nodeprecated>false</nodeprecated>
          <nodeprecatedlist>false</nodeprecatedlist>
          <noindex>false</noindex>
          <nonavbar>false</nonavbar>
          <notree>false</notree>
          <offlineLinks>
            <offlineLink>
              <url>http://download.oracle.com/javase/8/docs/api/</url>
              <location>${basedir}/lib/java</location>
            </offlineLink>
            <offlineLink>
              <url>http://docs.rdf4j.org/javadoc/${rdf4j.release}/</url>
              <location>${basedir}/lib/rdf4j</location>
            </offlineLink>
            <offlineLink>
              <!-- Apache only hosts the very latest version. -->
              <url>https://www.javadoc.io/doc/org.apache.jena/jena-core/${jena.version}/</url>
              <location>${basedir}/lib/jena</location>
            </offlineLink>
          </offlineLinks>
          <overview>${basedir}/src/main/javadoc/overview.html</overview>
          <reportOutputDirectory>${basedir}</reportOutputDirectory>
          <show>public</show>
          <source>1.8</source>
          <splitindex>true</splitindex>
          <use>true</use>
          <version>true</version>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Distribution building. -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.6</version>
        <configuration>
          <attach>false</attach>
        </configuration>
        <executions>
          <execution>
            <id>jar-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <appendAssemblyId>false</appendAssemblyId>
              <descriptors>
                <descriptor>src/assembly/dist.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- Required checkstyle checks -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.17</version>
        <executions>
          <!-- Check for main sources -->
          <execution>
            <id>validate</id>
            <phase>validate</phase>
            <configuration>
              <configLocation>checkstyle-required.xml</configLocation>
              <encoding>UTF-8</encoding>
              <consoleOutput>true</consoleOutput>
              <failsOnError>true</failsOnError>
            </configuration>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
          <!-- Checks for test sources -->
          <execution>
            <id>validate-tests</id>
            <phase>validate</phase>
            <configuration>
              <sourceDirectories>${project.testCompileSourceRoots}</sourceDirectories>
              <configLocation>checkstyle-tests.xml</configLocation>
              <encoding>UTF-8</encoding>
              <consoleOutput>true</consoleOutput>
              <failsOnError>true</failsOnError>
            </configuration>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>2.19.1</version>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
        <version>3.0.4</version>
        <configuration>
          <effort>Max</effort>
          <threshold>Low</threshold>
          <xmlOutput>true</xmlOutput>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.17</version>
        <configuration>
          <configLocation>checkstyle.xml</configLocation>
        </configuration>
        <reportSets>
          <reportSet>
            <reports>
              <report>checkstyle</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>

  <!-- Get dependencies from the central repository only. -->
  <repositories>
    <repository>
      <id>central</id>
      <url>https://repo1.maven.org/maven2</url>
    </repository>
  </repositories>

  <!-- Deploy to the OSSRH Nexus Repository Manager.
       Access credentials are configured in settings.xml.
       See https://books.sonatype.com/nexus-book/reference/usertoken.html -->
  <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>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.1</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.eclipse.rdf4j</groupId>
      <artifactId>rdf4j-sparql-testsuite</artifactId>
      <version>${rdf4j.version}</version>
      <scope>test</scope>
    </dependency>
    
    <dependency>
      <groupId>org.eclipse.rdf4j</groupId>
      <artifactId>rdf4j-store-testsuite</artifactId>
      <version>${rdf4j.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.jena</groupId>
      <artifactId>jena-core</artifactId>
      <version>${jena.version}</version>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.jena</groupId>
      <artifactId>jena-arq</artifactId>
      <version>${jena.version}</version>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.eclipse.rdf4j</groupId>
      <artifactId>rdf4j-model</artifactId>
      <version>${rdf4j.version}</version>
    </dependency>

    <dependency>
      <groupId>org.eclipse.rdf4j</groupId>
      <artifactId>rdf4j-runtime</artifactId>
      <version>${rdf4j.version}</version>
      <exclusions>
        <!-- Libraries are not supposed to depend on a concrete
             implementation of a logging framework, but RDF4J does.
             Note that all logging in RDF4J is still done using SLF4J,
             so removing logback does not break anything. -->
        <exclusion>
          <groupId>ch.qos.logback</groupId>
          <artifactId>logback-classic</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.eclipse.rdf4j</groupId>
      <artifactId>rdf4j-rio-nquads</artifactId>
      <version>${rdf4j.version}</version>
    </dependency>

    <dependency>
      <groupId>org.eclipse.rdf4j</groupId>
      <artifactId>rdf4j-rio-rdfxml</artifactId>
      <version>${rdf4j.version}</version>
    </dependency>
    
    <dependency>
      <groupId>org.apache.jena</groupId>
      <artifactId>jena-core</artifactId>
      <version>${jena.version}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.jena</groupId>
      <artifactId>jena-arq</artifactId>
      <version>${jena.version}</version>
    </dependency>

    <!-- TODO: Switch to Jackson. -->
    <dependency>
      <groupId>org.json</groupId>
      <artifactId>json</artifactId>
      <version>20160810</version>
    </dependency>


    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.25</version>
    </dependency>
    
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <version>4.5.13</version>
      <exclusions>
        <exclusion>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-codec</groupId>
          <artifactId>commons-codec</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>1.1.1</version>
    </dependency>

    <dependency>
      <groupId>commons-cli</groupId>
      <artifactId>commons-cli</artifactId>
      <version>1.2</version>
    </dependency>
    
    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
      <version>1.4</version>
    </dependency>

    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.11.0</version>
    </dependency>

    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-pool2</artifactId>
      <version>2.4.2</version>
    </dependency>

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.5</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.rdf4j</groupId>
      <artifactId>rdf4j-queryresultio-text</artifactId>
      <version>${rdf4j.version}</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.rdf4j</groupId>
      <artifactId>rdf4j-queryresultio-sparqljson</artifactId>
      <version>${rdf4j.version}</version>
    </dependency>
    <dependency>
      <groupId>com.atomikos</groupId>
      <artifactId>transactions-jta</artifactId>
      <version>4.0.6</version>
    </dependency>
  </dependencies>
</project>
