<!--
 ! Licensed to the Apache Software Foundation (ASF) under one
 ! or more contributor license agreements.  See the NOTICE file
 ! distributed with this work for additional information
 ! regarding copyright ownership.  The ASF licenses this file
 ! to you 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>
  <groupId>org.apache.asterix</groupId>
  <artifactId>apache-asterixdb-jdbc</artifactId>
  <version>0.9.8.2</version>
  <packaging>pom</packaging>
  <parent>
    <groupId>org.apache</groupId>
    <artifactId>apache</artifactId>
    <version>18</version>
    <relativePath />
  </parent>
  <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>
  <scm>
    <connection>scm:git:https://github.com/apache/asterixdb-clients</connection>
    <developerConnection>scm:git:ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb-clients</developerConnection>
    <url>https://github.com/apache/asterixdb</url>
    <tag>HEAD</tag>
  </scm>
  <properties>
    <root.dir>${basedir}</root.dir>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <file.encoding>UTF-8</file.encoding>
    <source.jdk.version>8</source.jdk.version>
    <target.jdk.version>8</target.jdk.version>
    <javac.xlint.value>all</javac.xlint.value>
    <jvm.extraargs />
    <source-format.goal>format</source-format.goal>
    <source-format.skip>false</source-format.skip>
    <import-sort.goal>sort</import-sort.goal>
    <import-sort.skip>false</import-sort.skip>
    <maven.test.skip>false</maven.test.skip>
    <skipTests>false</skipTests>
    <skip.surefire.tests>${skipTests}</skip.surefire.tests>
    <skip.testResources>${maven.test.skip}</skip.testResources>
    <test.includes>${global.test.includes}</test.includes>
    <test.excludes>${global.test.excludes}</test.excludes>

    <implementation.title>Apache AsterixDB JDBC - ${project.name}</implementation.title>
    <implementation.url>https://asterixdb.apache.org/</implementation.url>
    <implementation.version>${project.version}</implementation.version>
    <implementation.vendor>${project.organization.name}</implementation.vendor>

    <hyracks.version>0.3.7.1</hyracks.version>
    <commons-lang3.version>3.12.0</commons-lang3.version>
    <commons-collections4.version>4.4</commons-collections4.version>
    <httpcore.version>4.4.14</httpcore.version>
    <httpclient.version>4.5.13</httpclient.version>
    <jackson-core.version>2.13.2</jackson-core.version>
    <jackson-annotations.version>2.13.2</jackson-annotations.version>
    <jackson-databind.version>2.13.2.2</jackson-databind.version>
    <junit.version>4.13.2</junit.version>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <excludes combine.children="append">
            <exclude>**/DEPENDENCIES</exclude>
          </excludes>
          <archive>
            <addMavenDescriptor>false</addMavenDescriptor>
            <manifest>
              <addDefaultImplementationEntries>false</addDefaultImplementationEntries>
              <addDefaultSpecificationEntries>false</addDefaultSpecificationEntries>
            </manifest>
            <manifestEntries>
              <Implementation-Title>${implementation.title}</Implementation-Title>
              <Implementation-URL>${implementation.url}</Implementation-URL>
              <Implementation-Version>${implementation.version}</Implementation-Version>
              <Implementation-Vendor>${implementation.vendor}</Implementation-Vendor>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <configuration>
          <failOnWarning>true</failOnWarning>
          <outputXML>true</outputXML>
        </configuration>
        <executions>
          <execution>
            <phase>process-test-classes</phase>
            <goals>
              <goal>analyze-only</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <addDefaultLicenseMatchers>false</addDefaultLicenseMatchers>
          <consoleOutput>true</consoleOutput>
          <licenses>
            <license implementation="org.apache.rat.analysis.license.ApacheSoftwareLicense20" />
          </licenses>
          <licenseFamilies>
            <licenseFamily implementation="org.apache.rat.license.Apache20LicenseFamily" />
          </licenseFamilies>
          <excludeSubProjects>true</excludeSubProjects>
          <excludes combine.children="append">
            <exclude>**/*.iml</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <failIfNoTests>false</failIfNoTests>
          <forkCount>1</forkCount>
          <reuseForks>false</reuseForks>
          <argLine>-enableassertions -Xmx2048m -Dfile.encoding=UTF-8 -Xdebug
            -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n ${coverageArgLine}
          </argLine>
          <systemPropertyVariables>
            <log4j.configurationFile>${testLog4jConfigFile}</log4j.configurationFile>
          </systemPropertyVariables>
          <includes>
            <include>${test.includes}</include>
          </includes>
          <excludes combine.children="append">
            <exclude>${test.excludes}</exclude>
          </excludes>
          <skipTests>${skip.surefire.tests}</skipTests>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <configuration>
          <systemPropertyVariables>
            <log4j.configurationFile>${testLog4jConfigFile}</log4j.configurationFile>
          </systemPropertyVariables>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>${source.jdk.version}</source>
          <target>${target.jdk.version}</target>
          <compilerArgument>-Xlint:${javac.xlint.value}</compilerArgument>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>3.0.0</version>
        <executions>
          <execution>
            <id>verify-style</id>
            <phase>process-sources</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <logViolationsToConsole>true</logViolationsToConsole>
          <checkstyleRules>
            <module name="Checker">
              <!-- Checks for whitespace                               -->
              <!-- See http://checkstyle.sf.net/config_whitespace.html -->
              <module name="FileTabCharacter" />
              <module name="TreeWalker">
                <module name="AvoidStarImport">
                  <property name="allowStaticMemberImports" value="true"/>
                </module>
              </module>
            </module>
          </checkstyleRules>
          <includes>**/*.java,**/*.jj</includes>
          <resourceIncludes>**/*.properties,**/*.xml,**/*.xsd,**/*.sh</resourceIncludes>
          <sourceDirectories>${project.build.sourceDirectory},${project.build.testSourceDirectory}</sourceDirectories>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>check-pom-packaging</id>
            <phase>validate</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <exportAntProperties>true</exportAntProperties>
              <target xmlns:unless="ant:unless">
                <condition property="skipPomEnforcement">
                  <not><equals arg1="${project.packaging}" arg2="pom"/></not>
                </condition>
                <echo message="will enforce non-existence of test source dir due to ${project.packaging} packaging" unless:set="skipPomEnforcement"/>
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>ensure-no-tests-for-pom-packaging</id>
            <phase>validate</phase>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireFilesDontExist>
                  <files>
                    <file>${project.build.testSourceDirectory}</file>
                  </files>
                  <message>#### Tests cannot exist in projects with '${project.packaging}' packaging!</message>
                </requireFilesDontExist>
              </rules>
              <skip>${skipPomEnforcement}</skip>
            </configuration>
          </execution>
          <execution>
            <id>enforce-versions</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>[3.3.9,)</version>
                </requireMavenVersion>
                <requireJavaVersion>
                  <version>[11,)</version>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>
          <execution>
            <id>ensure-no-duplicate-deps</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <banDuplicatePomDependencyVersions/>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>default-testResources</id>
            <goals>
              <goal>testResources</goal>
            </goals>
            <configuration>
              <skip>${skip.testResources}</skip>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>net.revelc.code.formatter</groupId>
        <artifactId>formatter-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>${source-format.goal}</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <configFile>${root.dir}/AsterixCodeFormatProfile.xml</configFile>
          <skipFormatting>${source-format.skip}</skipFormatting>
        </configuration>
      </plugin>
      <plugin>
        <groupId>net.revelc.code</groupId>
        <artifactId>impsort-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>${import-sort.goal}</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <groups>java,javax,org,com,*</groups>
          <removeUnused>true</removeUnused>
          <skip>${import-sort.skip}</skip>
        </configuration>
      </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.rat</groupId>
          <artifactId>apache-rat-plugin</artifactId>
          <version>0.12</version>
        </plugin>
        <plugin>
          <groupId>net.revelc.code.formatter</groupId>
          <artifactId>formatter-maven-plugin</artifactId>
          <version>2.0.1</version>
        </plugin>
        <plugin>
          <groupId>net.revelc.code</groupId>
          <artifactId>impsort-maven-plugin</artifactId>
          <version>1.2.0</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>versions-maven-plugin</artifactId>
          <version>2.5</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-scm-plugin</artifactId>
          <version>1.9.5</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.21.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>2.21.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>1.8</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.0.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>3.1.2</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>1.6.0</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>3.0.0-M3</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>3.2.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.hyracks</groupId>
          <artifactId>license-automation-plugin</artifactId>
          <version>${hyracks.version}</version>
          <configuration>
            <argLine>-Xmx2048m</argLine>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>${commons-lang3.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-collections4</artifactId>
        <version>${commons-collections4.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpcore</artifactId>
        <version>${httpcore.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>${httpclient.version}</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>${jackson-databind.version}</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>${jackson-core.version}</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-annotations</artifactId>
        <version>${jackson-annotations.version}</version>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <modules>
    <module>asterix-jdbc-core</module>
    <module>asterix-jdbc-driver</module>
    <module>asterix-jdbc-taco</module>
  </modules>

  <profiles>
    <profile>
      <id>asterix-jdbc-test-enabled</id>
      <activation>
        <file>
        <exists>${basedir}/../../asterix-app/pom.xml</exists>
        </file>
      </activation>
      <modules>
        <module>asterix-jdbc-test</module>
      </modules>
    </profile>
  </profiles>

</project>