<!--

         Copyright (C) 2012-2015 DataStax Inc.

      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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
    <relativePath />
  </parent>

  <groupId>com.datastax.cassandra</groupId>
  <artifactId>cassandra-driver-parent</artifactId>
  <version>3.0.0-rc1</version>
  <packaging>pom</packaging>
  <name>DataStax Java Driver for Apache Cassandra</name>
  <description>A driver for Apache Cassandra 1.2+ that works exclusively with the Cassandra Query Language version 3 (CQL3) and Cassandra's binary protocol.</description>
  <url>https://github.com/datastax/java-driver</url>
  <inceptionYear>2012</inceptionYear>

  <modules>
    <module>driver-core</module>
    <module>driver-mapping</module>
    <module>driver-extras</module>
    <module>driver-examples</module>
    <module>driver-dse</module>
    <module>driver-dist</module>
  </modules>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <cassandra.version>3.0.0</cassandra.version>
    <java.version>1.6</java.version>
    <log4j.version>1.2.17</log4j.version>
    <slf4j-log4j12.version>1.7.6</slf4j-log4j12.version>
    <guava.version>16.0.1</guava.version>
    <netty.version>4.0.33.Final</netty.version>
    <metrics.version>3.1.2</metrics.version>
    <snappy.version>1.0.5</snappy.version>
    <lz4.version>1.2.0</lz4.version>
    <hdr.version>2.1.4</hdr.version>
    <!-- driver-extras module -->
    <jackson.version>2.6.3</jackson.version>
    <joda.version>2.9.1</joda.version>
    <jsr353-api.version>1.0</jsr353-api.version>
    <jsr353-ri.version>1.0.4</jsr353-ri.version>
    <!-- test dependency versions -->
    <testng.version>6.8.8</testng.version>
    <assertj.version>1.7.0</assertj.version>
    <mockito.version>1.10.8</mockito.version>
    <commons-exec.version>1.3</commons-exec.version>
    <scassandra.version>0.11.0</scassandra.version>
    <main.basedir>${project.basedir}</main.basedir>
    <ipprefix>127.0.1.</ipprefix>
    <currentYear>2015</currentYear>
    <!-- Set default javadoc.opts, overriden by profiles -->
    <javadoc.opts />
  </properties>

  <dependencies>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>${log4j.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>${slf4j-log4j12.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <profiles>

    <profile>
      <id>doclint-java8-disable</id>
      <activation>
        <jdk>[1.8,)</jdk>
      </activation>
      <properties>
        <javadoc.opts>-Xdoclint:none</javadoc.opts>
      </properties>
    </profile>

    <profile>
      <id>enforce-java8</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>1.4.1</version>
            <executions>
              <execution>
                <id>enforce-java8</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireJavaVersion>
                      <version>1.8</version>
                    </requireJavaVersion>
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

  </profiles>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.3</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
          <optimize>true</optimize>
          <showDeprecation>true</showDeprecation>
          <showWarnings>true</showWarnings>
          <!--
          Avoids warnings when cross-compiling to older source levels, see
          https://blogs.oracle.com/darcy/entry/bootclasspath_older_source
          -->
          <compilerArgument>-Xlint:-options</compilerArgument>
          <!-- this actually means: use incremental compilation -->
          <useIncrementalCompilation>false</useIncrementalCompilation>
        </configuration>
      </plugin>
      <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>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.9.1</version>
        <inherited>true</inherited>
        <configuration>
          <verbose>false</verbose>
          <additionalparam>${javadoc.opts}</additionalparam>
          <!-- I can haz math in my javadoc (see http://zverovich.net/2012/01/14/beautiful-math-in-javadoc.html) -->
          <header>
            &lt;script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"&gt;&lt;/script&gt;
          </header>
          <!-- open external links in a separate window -->
          <bottom>
            &lt;script type="text/javascript"&gt;
            for(var i in document.links) {
            var link = document.links[i];
            if (link.href.indexOf('is-external=true') != -1) link.target = '_blank';
            }
            &lt;/script&gt;
          </bottom>
          <links>
            <link>https://docs.oracle.com/javase/8/docs/api/</link>
            <link>http://docs.guava-libraries.googlecode.com/git-history/v16.0.1/javadoc/</link>
            <link>http://netty.io/4.0/api/</link>
            <!-- dependencies from driver-extras -->
            <link>http://www.joda.org/joda-time/apidocs/</link>
            <link>http://fasterxml.github.io/jackson-core/javadoc/2.6/</link>
            <link>http://fasterxml.github.io/jackson-databind/javadoc/2.6/</link>
            <link>https://javaee-spec.java.net/nonav/javadocs/</link>
          </links>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <tagNameFormat>@{project.version}</tagNameFormat>
          <preparationGoals>clean verify -Penforce-java8</preparationGoals>
          <!-- do NOT specify arguments tag here as it would override the arguments tag in this plugin's definition in the parent POM -->
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>clirr-maven-plugin</artifactId>
        <version>2.7</version>
        <executions>
          <execution>
            <phase>compile</phase>
            <goals><goal>check</goal></goals>
          </execution>
        </executions>
        <configuration>
          <comparisonVersion>3.0.0</comparisonVersion>
          <ignoredDifferencesFile>../clirr-ignores.xml</ignoredDifferencesFile>
          <excludes>
            <!-- Package-private, internal classes -->
            <exclude>com/datastax/driver/core/Frame$*</exclude>
            <exclude>com/datastax/driver/core/ProtocolEvent$*</exclude>
            <exclude>com/datastax/driver/core/Message$*</exclude>
            <exclude>com/datastax/driver/core/Requests$*</exclude>
            <exclude>com/datastax/driver/core/Responses$*</exclude>
            <exclude>com/datastax/driver/core/Connection$*</exclude>
          </excludes>
        </configuration>
        <!--
        Workaround to make clirr plugin work with Java 8.
        The bug is actually in the BCEL library,
        see https://issues.apache.org/jira/browse/BCEL-173.
        See also https://github.com/RichardWarburton/lambda-behave/issues/31#issuecomment-86052095
        -->
        <dependencies>
          <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>bcel-findbugs</artifactId>
            <version>6.0</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.9.1</version>
        <executions>
          <execution>
            <id>timestamp-property</id>
            <phase>initialize</phase>
            <goals>
              <goal>timestamp-property</goal>
            </goals>
            <configuration>
              <name>currentYear</name>
              <pattern>yyyy</pattern>
              <locale>en_US</locale>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!--
      To update license headers run:
      mvn license:format -DcurrentYear=XXXX
      -->
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>2.8</version>
        <configuration>
          <header>${main.basedir}/src/license/header.txt</header>
          <includes>
            <include>src/**/*.java</include>
            <include>src/**/*.xml</include>
            <include>src/**/*.properties</include>
            <include>**/pom.xml</include>
          </includes>
          <excludes>
            <exclude>**/src/main/config/ide/**</exclude>
          </excludes>
          <mapping>
            <java>SLASHSTAR_STYLE</java>
            <properties>SCRIPT_STYLE</properties>
          </mapping>
          <strictCheck>true</strictCheck>
        </configuration>
        <executions>
          <execution>
            <id>check-license</id>
            <phase>initialize</phase>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <properties>
                <currentYear>${currentYear}</currentYear>
              </properties>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>animal-sniffer-maven-plugin</artifactId>
        <version>1.14</version>
        <configuration>
          <signature>
            <groupId>org.codehaus.mojo.signature</groupId>
            <artifactId>java16</artifactId>
            <version>1.0</version>
          </signature>
        </configuration>
        <executions>
          <execution>
            <id>check</id>
            <phase>compile</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <licenses>
    <license>
      <name>Apache 2</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
      <comments>Apache License Version 2.0</comments>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:git@github.com:datastax/java-driver.git</connection>
    <developerConnection>scm:git:git@github.com:datastax/java-driver.git</developerConnection>
    <url>https://github.com/datastax/java-driver</url>
    <tag>3.0.0-rc1</tag>
  </scm>

  <developers>
    <developer>
      <name>Various</name>
      <organization>DataStax</organization>
    </developer>
  </developers>
</project>
