blob: 6d971079719c6815c0964e1b999867d8bc980337 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.griffin</groupId>
<artifactId>griffin</artifactId>
<version>0.7.0-SNAPSHOT</version>
</parent>
<artifactId>measure</artifactId>
<packaging>jar</packaging>
<name>Apache Griffin :: Measure</name>
<url>http://griffin.apache.org</url>
<properties>
<!-- Spark -->
<spark.major.version>2.4</spark.major.version>
<spark.version>${spark.major.version}.4</spark.version>
<spark.scope>${provided.scope}</spark.scope>
<spark-streaming-kafka.version>${spark.version}</spark-streaming-kafka.version>
<!-- Code Standardization -->
<scalastyle.version>1.0.0</scalastyle.version>
<scalafmt.version>1.0.3</scalafmt.version>
<!-- Data Connectors -->
<mysql.java.version>5.1.47</mysql.java.version>
<mariadb.version>2.7.0</mariadb.version>
<cassandra.connector.version>2.5.1</cassandra.connector.version>
<elasticsearch.version>6.4.1</elasticsearch.version>
<scalaj.version>2.3.0</scalaj.version>
<mongo.version>2.1.0</mongo.version>
<curator.version>2.10.0</curator.version>
<!-- Testing -->
<scoverage.plugin.version>1.4.0</scoverage.plugin.version>
<mockito.version>3.2.2.0</mockito.version>
<scalatest.version>3.2.3</scalatest.version>
<maven.surefire.plugin.version>2.22.2</maven.surefire.plugin.version>
<scoverage.plugin.version>1.4.0</scoverage.plugin.version>
<scalatest.maven.plugin.version>2.0.2</scalatest.maven.plugin.version>
<scapegoat.version>1.4.8</scapegoat.version>
</properties>
<dependencies>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>
<dependency>
<groupId>com.sksamuel.scapegoat</groupId>
<artifactId>scalac-scapegoat-plugin_${scala.version}</artifactId>
<version>${scapegoat.version}</version>
<scope>provided</scope>
</dependency>
<!-- Spark Dependencies -->
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_${scala.binary.version}</artifactId>
<version>${spark.version}</version>
<scope>${spark.scope}</scope>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_${scala.binary.version}</artifactId>
<version>${spark.version}</version>
<scope>${spark.scope}</scope>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-streaming_${scala.binary.version}</artifactId>
<version>${spark.version}</version>
<scope>${spark.scope}</scope>
</dependency>
<!-- Data Connectors -->
<!-- Spark Hive-->
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-hive_${scala.binary.version}</artifactId>
<version>${spark.version}</version>
<scope>${spark.scope}</scope>
</dependency>
<!-- Spark Kafka-->
<!-- TODO
Spark Streaming Kafka 08 is not cross compiled with scala 2.12.
Thus, this dependency has been temporary un-banned in the enforcer plugin.
This will be removed with structured streaming implementation
-->
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-streaming-kafka-0-8_${scala211.binary.version}</artifactId>
<version>${spark-streaming-kafka.version}</version>
<exclusions>
<exclusion>
<groupId>org.scala-lang.modules</groupId>
<artifactId>scala-xml_2.11</artifactId>
</exclusion>
<exclusion>
<groupId>org.scala-lang.modules</groupId>
<artifactId>scala-parser-combinators_2.11</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.spark</groupId>
<artifactId>spark-tags_2.11</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- MongoDB-->
<dependency>
<groupId>org.mongodb.scala</groupId>
<artifactId>mongo-scala-driver_${scala.binary.version}</artifactId>
<version>${mongo.version}</version>
</dependency>
<!-- MySql -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.java.version}</version>
</dependency>
<!-- MariaDB -->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>${mariadb.version}</version>
</dependency>
<!-- Spark Cassandra-->
<dependency>
<groupId>com.datastax.spark</groupId>
<artifactId>spark-cassandra-connector_${scala.binary.version}</artifactId>
<version>${cassandra.connector.version}</version>
</dependency>
<!-- Spark Elasticsearch-->
<!-- TODO
Elasticsearch Spark has recently added support for scala 2.12 but it is not published in the Maven Central yet.
Thus, this dependency has been temporary un-banned in the enforcer plugin.
See https://github.com/elastic/elasticsearch-hadoop/pull/1589#issuecomment-776920189
-->
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch-spark-20_${scala211.binary.version}</artifactId>
<version>${elasticsearch.version}</version>
</dependency>
<!-- Miscellaneous-->
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-recipes</artifactId>
<version>${curator.version}</version>
</dependency>
<dependency>
<groupId>org.scalaj</groupId>
<artifactId>scalaj-http_${scala.binary.version}</artifactId>
<version>${scalaj.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.9</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_${scala.binary.version}</artifactId>
<version>${scalatest.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.scalatestplus</groupId>
<artifactId>mockito-3-4_${scala.binary.version}</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.200</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>elasticsearch</artifactId>
<version>1.14.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>src/main/scala</sourceDirectory>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>4.3.0</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<checkMultipleScalaVersions>true</checkMultipleScalaVersions>
<failOnMultipleScalaVersions>true</failOnMultipleScalaVersions>
<recompileMode>incremental</recompileMode>
<args>
<arg>-unchecked</arg>
<arg>-deprecation</arg>
<arg>-feature</arg>
<arg>-explaintypes</arg>
<arg>-P:scapegoat:dataDir:${project.build.directory}</arg>
<arg>-P:scapegoat:reports:scalastyle</arg>
<arg>
-P:scapegoat:overrideLevels:UnsafeTraversableMethods=Warning:OptionGet=Warning:TryGet=Warning
</arg>
</args>
<jvmArgs>
<jvmArg>-Xmx1024m</jvmArg>
</jvmArgs>
<javacArgs>
<javacArg>-source</javacArg>
<javacArg>-target</javacArg>
<javacArg>${java.version}</javacArg>
<javacArg>-Xlint:all,-serial,-path,-try</javacArg>
</javacArgs>
<compilerPlugins>
<compilerPlugin>
<groupId>com.sksamuel.scapegoat</groupId>
<artifactId>scalac-scapegoat-plugin_${scala.version}</artifactId>
<version>${scapegoat.version}</version>
</compilerPlugin>
</compilerPlugins>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin.version}</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.scalatest</groupId>
<artifactId>scalatest-maven-plugin</artifactId>
<version>${scalatest.maven.plugin.version}</version>
<configuration>
<testFailureIgnore>false</testFailureIgnore>
<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
<junitxml>.</junitxml>
<filereports>TestSuiteReport.txt</filereports>
<parallel>false</parallel>
<forkMode>once</forkMode>
<stderr/>
<argLine>
-ea -Xmx4g -Xss4m -XX:ReservedCodeCacheSize=1g -Dio.netty.tryReflectionSetAccessible=true
-Dfile.encoding=${project.build.sourceEncoding}
</argLine>
<systemProperties>
<java.io.tmpdir>${project.build.directory}/tmp</java.io.tmpdir>
</systemProperties>
</configuration>
<executions>
<execution>
<id>test</id>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>org.apache.http</pattern>
<shadedPattern>griffin.org.apache.http</shadedPattern>
</relocation>
<relocation>
<pattern>com.zaxxer</pattern>
<shadedPattern>griffin.com.zaxxer</shadedPattern>
</relocation>
</relocations>
<finalName>${project.build.finalName}-with-dependencies</finalName>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.apache.griffin.measure.Application</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.antipathy</groupId>
<artifactId>mvn-scalafmt_${scala.binary.version}</artifactId>
<version>${scalafmt.version}</version>
<configuration>
<configLocation>${project.parent.basedir}/.scalafmt.conf</configLocation>
<skipTestSources>false</skipTestSources>
<skipSources>false</skipSources>
<respectVersion>false</respectVersion>
<validateOnly>false</validateOnly>
</configuration>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>format</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.scalastyle</groupId>
<artifactId>scalastyle-maven-plugin</artifactId>
<version>${scalastyle.version}</version>
<configuration>
<verbose>false</verbose>
<failOnViolation>true</failOnViolation>
<includeTestSourceDirectory>false</includeTestSourceDirectory>
<failOnWarning>false</failOnWarning>
<sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
<testSourceDirectory>${project.build.testSourceDirectory}</testSourceDirectory>
<configLocation>${project.parent.basedir}/scalastyle-config.xml</configLocation>
<outputFile>${basedir}/target/scalastyle-output.xml</outputFile>
<inputEncoding>${project.build.sourceEncoding}</inputEncoding>
<outputEncoding>${project.reporting.outputEncoding}</outputEncoding>
</configuration>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.scoverage</groupId>
<artifactId>scoverage-maven-plugin</artifactId>
<version>${scoverage.plugin.version}</version>
<configuration>
<scalaVersion>${scala.version}</scalaVersion>
<aggregateOnly>true</aggregateOnly>
<highlighting>true</highlighting>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M2</version>
<executions>
<execution>
<id>enforce-versions</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireJavaVersion>
<version>${java.version}</version>
</requireJavaVersion>
<bannedDependencies>
<excludes>
<exclude>*:*_2.10</exclude>
<exclude>*:*_2.12</exclude>
<exclude>*:*_2.13</exclude>
</excludes>
<searchTransitive>true</searchTransitive>
</bannedDependencies>
</rules>
</configuration>
</execution>
<execution>
<id>enforce-no-duplicate-dependencies</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<banDuplicatePomDependencyVersions/>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<!-- Scala 2.12 -->
<profile>
<id>scala-2.12</id>
<activation>
<property>
<name>scala-2.12</name>
</property>
</activation>
<properties>
<scala.binary.version>2.12</scala.binary.version>
<scala.version>${scala.binary.version}.12</scala.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-versions</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireJavaVersion>
<version>${java.version}</version>
</requireJavaVersion>
<bannedDependencies>
<!-- TODO Temporary Fix: These will be removed in a future iteration. -->
<includes>
<include>org.elasticsearch:elasticsearch-spark-20_2.11:*</include>
<include>org.apache.spark:spark-streaming-kafka-0-8_2.11:*</include>
<include>org.apache.kafka:kafka_2.11:*</include>
</includes>
<excludes>
<exclude>*:*_2.10</exclude>
<exclude>*:*_2.11</exclude>
<exclude>*:*_2.13</exclude>
</excludes>
<searchTransitive>true</searchTransitive>
</bannedDependencies>
</rules>
</configuration>
</execution>
<execution>
<id>enforce-no-duplicate-dependencies</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<banDuplicatePomDependencyVersions/>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- Spark 2.3.x -->
<profile>
<id>spark-2.3</id>
<activation>
<property>
<name>spark-2.3</name>
</property>
</activation>
<properties>
<spark.major.version>2.3</spark.major.version>
<spark.version>${spark.major.version}.4</spark.version>
</properties>
<dependencies>
<!-- Old Spark Avro-->
<dependency>
<groupId>com.databricks</groupId>
<artifactId>spark-avro_${scala211.binary.version}</artifactId>
<version>4.0.0</version>
</dependency>
</dependencies>
</profile>
<!-- Spark 3.0.x -->
<profile>
<id>spark-3.0</id>
<activation>
<property>
<name>spark-3.0</name>
</property>
</activation>
<properties>
<spark.major.version>3.0</spark.major.version>
<spark.version>${spark.major.version}.2</spark.version>
<spark-streaming-kafka.version>2.4.7</spark-streaming-kafka.version>
</properties>
</profile>
<!-- Spark 2.4+ Avro -->
<profile>
<id>spark-avro-2.4</id>
<activation>
<property>
<name>!spark-2.3</name>
</property>
</activation>
<dependencies>
<!-- New Spark Avro-->
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-avro_${scala.binary.version}</artifactId>
<version>${spark.version}</version>
</dependency>
</dependencies>
</profile>
</profiles>
</project>