<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 2020 Deephaven Data Labs

  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>

  <parent>
    <groupId>org.apache</groupId>
    <artifactId>apache</artifactId>
    <version>18</version>
  </parent>

  <groupId>io.deephaven.barrage</groupId>
  <artifactId>barrage-java-root</artifactId>
  <version>0.7.2</version>
  <packaging>pom</packaging>

  <name>Deephaven Data Labs' Barrage Java Root POM</name>
  <description>Deephaven Data Labs' Barrage is open source, that adds a ticking RPC API on top of Apache Arrow.</description>
  <url>https://www.deephaven.io/</url>

  <properties>
    <maven.compiler.release>8</maven.compiler.release>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <dep.fbs.version>24.3.25</dep.fbs.version>
    <dep.arrow.version>18.0.0</dep.arrow.version>
  </properties>

  <licenses>
    <license>
      <name>The Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Nathaniel Bauernfeind</name>
      <email>natebauernfeind@deephaven.io</email>
      <organization>Deephaven Data Labs</organization>
      <organizationUrl>https://www.deephaven.io</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:https://github.com/deephaven/barrage.git</connection>
    <developerConnection>scm:git:https://github.com/deephaven/barrage.git</developerConnection>
    <url>https://github.com/deephaven/barrage</url>
    <tag>v0.7.2</tag>
  </scm>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <executions>
          <execution>
            <id>rat-checks</id>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <excludeSubProjects>false</excludeSubProjects>
          <excludes>
            <exclude>**/dependency-reduced-pom.xml</exclude>
            <exclude>**/*.log</exclude>
            <exclude>**/*.css</exclude>
            <exclude>**/*.js</exclude>
            <exclude>**/*.md</exclude>
            <exclude>**/*.eps</exclude>
            <exclude>**/*.json</exclude>
            <exclude>**/*.seq</exclude>
            <exclude>**/*.parquet</exclude>
            <exclude>**/*.sql</exclude>
            <exclude>**/git.properties</exclude>
            <exclude>**/*.csv</exclude>
            <exclude>**/*.csvh</exclude>
            <exclude>**/*.csvh-test</exclude>
            <exclude>**/*.tsv</exclude>
            <exclude>**/*.txt</exclude>
            <exclude>**/*.ssv</exclude>
            <exclude>**/arrow-*.conf</exclude>
            <exclude>**/.buildpath</exclude>
            <exclude>**/*.proto</exclude>
            <exclude>**/*.fmpp</exclude>
            <exclude>**/target/**</exclude>
            <exclude>**/*.tdd</exclude>
            <exclude>**/*.project</exclude>
            <exclude>**/TAGS</exclude>
            <exclude>**/*.checkstyle</exclude>
            <exclude>**/.classpath</exclude>
            <exclude>**/.settings/**</exclude>
            <exclude>.*/**</exclude>
            <exclude>**/*.patch</exclude>
            <exclude>**/*.pb.cc</exclude>
            <exclude>**/*.pb.h</exclude>
            <exclude>**/*.linux</exclude>
            <exclude>**/client/build/**</exclude>
            <exclude>**/*.tbl</exclude>
            <exclude>**/*.iml</exclude>
          </excludes>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>**/logging.properties</exclude>
            <exclude>**/logback-test.xml</exclude>
            <exclude>**/logback.out.xml</exclude>
            <exclude>**/logback.xml</exclude>
          </excludes>
          <archive>
            <index>true</index>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
            </manifest>
            <manifestEntries>
              <Extension-Name>io.deephaven.barrage</Extension-Name>
              <Built-By>${username}</Built-By>
              <url>https://github.com/deephaven/barrage/</url>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>avoid_bad_dependencies</id>
            <phase>verify</phase>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <bannedDependencies>
                  <excludes>
                    <exclude>commons-logging</exclude>
                    <exclude>javax.servlet:servlet-api</exclude>
                    <exclude>org.mortbay.jetty:servlet-api</exclude>
                    <exclude>org.mortbay.jetty:servlet-api-2.5</exclude>
                    <exclude>log4j:log4j</exclude>
                  </excludes>
                </bannedDependencies>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>pl.project13.maven</groupId>
        <artifactId>git-commit-id-plugin</artifactId>
        <version>4.9.10</version>
        <executions>
          <execution>
            <id>for-jars</id>
            <inherited>true</inherited>
            <goals>
              <goal>revision</goal>
            </goals>
            <configuration>
              <generateGitPropertiesFilename>target/classes/git.properties</generateGitPropertiesFilename>
            </configuration>
          </execution>
          <execution>
            <id>for-source-tarball</id>
            <goals>
              <goal>revision</goal>
            </goals>
            <inherited>false</inherited>
            <configuration>
              <generateGitPropertiesFilename>./git.properties</generateGitPropertiesFilename>
            </configuration>
          </execution>
        </executions>

        <configuration>
          <dateFormat>dd.MM.yyyy '@' HH:mm:ss z</dateFormat>
          <verbose>false</verbose>
          <skipPoms>false</skipPoms>
          <generateGitPropertiesFile>true</generateGitPropertiesFile>
          <failOnNoGitDirectory>false</failOnNoGitDirectory>
          <gitDescribe>
            <skip>false</skip>
            <always>false</always>
            <abbrev>7</abbrev>
            <dirty>-dirty</dirty>
            <forceLongFormat>true</forceLongFormat>
          </gitDescribe>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>analyze</id>
            <phase>verify</phase>
            <goals>
              <goal>analyze-only</goal>
            </goals>
            <configuration>
              <ignoreNonCompile>true</ignoreNonCompile>
              <failOnWarning>true</failOnWarning>
              <ignoredDependencies>
                <!-- source annotations (not kept in compiled code) -->
                <ignoredDependency>javax.annotation:javax.annotation-api:*</ignoredDependency>
              </ignoredDependencies>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- Release tags should be v<VERSION>. -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5.3</version>
        <configuration>
          <tagNameFormat>v@{project.version}</tagNameFormat>
        </configuration>
      </plugin>

      <!-- Release to OSS Sonatype / Maven Central. -->
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.7.0</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>oss.sonatype.org</serverId>
          <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
        </configuration>
      </plugin>

      <!--
        Sign artifacts with GPG.  This is a requirement of releasing to OSS
        Sonatype and Maven Central.
      -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>1.6</version>
        <executions>
          <execution>
            <id>sign-artifacts</id>
            <phase>verify</phase>
            <goals>
              <goal>sign</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>3.3.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.rat</groupId>
          <artifactId>apache-rat-plugin</artifactId>
          <version>0.15</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.3.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.13.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>3.0.0-M6</version>
          <configuration>
            <useReleaseProfile>false</useReleaseProfile>
            <pushChanges>false</pushChanges>
            <goals>deploy</goals>
            <arguments>-Papache-release ${arguments}</arguments>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.google.flatbuffers</groupId>
        <artifactId>flatbuffers-java</artifactId>
        <version>${dep.fbs.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.arrow</groupId>
        <artifactId>flight-core</artifactId>
        <version>${dep.arrow.version}</version>
        <exclusions>
          <exclusion>
            <groupId>io.netty</groupId>
            <artifactId>*</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.11.1</version>
        <reportSets>
          <reportSet><!-- by default, id = "default" -->
            <reports><!-- select non-aggregate reports -->
              <report>javadoc</report>
              <report>test-javadoc</report>
            </reports>
          </reportSet>
          <reportSet><!-- aggregate reportSet, to define in poms having modules -->
            <id>aggregate</id>
            <inherited>false</inherited><!-- don't run aggregate in child modules -->
            <reports>
              <report>aggregate</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>

  <modules>
    <module>format</module>
    <module>barrage-core</module>
  </modules>
</project>
