<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2016-2017 Seznam.cz, a.s.

    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>
  <groupId>cz.seznam.euphoria</groupId>
  <artifactId>euphoria-parent</artifactId>
  <version>0.7.0</version>
  <packaging>pom</packaging>
  <inceptionYear>2016</inceptionYear>

  <name>${project.groupId}:${project.artifactId}</name>
  <description>
    A Java API for creating unified big-data processing flows providing an
    engine independent programming model which can express both batch and
    stream transformations.
  </description>
  <url>https://github.com/seznam/euphoria</url>

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

  <scm>
    <connection>scm:git:git@github.com:seznam/euphoria.git</connection>
    <developerConnection>scm:git:git@github.com:seznam/euphoria.git</developerConnection>
    <url>https://github.com/seznam/euphoria/tree/master</url>
    <tag>v0.7.0</tag>
  </scm>

  <organization>
    <name>Seznam.cz, a.s.</name>
    <url>https://www.seznam.cz</url>
  </organization>

  <developers>
    <developer>
      <name>Jaromir Vanek</name>
      <email>jaromir.vanek2@firma.seznam.cz</email>
      <organization>Seznam a.s.</organization>
      <organizationUrl>https://www.seznam.cz</organizationUrl>
    </developer>
    <developer>
      <name>Jan Lukavsky</name>
      <email>jan.lukavsky@firma.seznam.cz</email>
      <organization>Seznam a.s.</organization>
      <organizationUrl>https://www.seznam.cz</organizationUrl>
    </developer>
    <developer>
      <name>Adam Horky</name>
      <email>adam.horky@firma.seznam.cz</email>
      <organization>Seznam a.s.</organization>
      <organizationUrl>https://www.seznam.cz</organizationUrl>
    </developer>
    <developer>
      <name>Petr Novotnik</name>
      <email>petr.novotnik@firma.seznam.cz</email>
      <organization>Seznam a.s.</organization>
      <organizationUrl>https://www.seznam.cz</organizationUrl>
    </developer>
  </developers>

  <modules>
    <module>euphoria-core</module>
    <module>euphoria-fluent</module>
    <module>euphoria-inmem</module>
    <module>euphoria-kafka</module>
    <module>euphoria-hadoop</module>
    <module>euphoria-operator-testkit</module>
    <module>euphoria-flink</module>
    <module>euphoria-spark</module>
    <module>euphoria-examples</module>
  </modules>

  <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>

  <build>
    <pluginManagement>
      <plugins>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <version>2.9</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <!--
            use at least 2.8 such that we can use
            -DaltReleaseDeploymentRepository and -DaltSnapshotDeploymentRepository
            from the outside
           -->
          <version>2.8.2</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.10.3</version>
          <configuration>
            <encoding>UTF-8</encoding>
            <quiet>true</quiet>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>2.5</version>
          <configuration>
            <encoding>UTF-8</encoding>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.3</version>
          <configuration>
            <source>1.8</source>
            <target>1.8</target>
            <encoding>UTF-8</encoding>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.0.2</version>
          <configuration>
            <archive>
              <manifestSections>
                <manifestSection>
                  <name>Package-Metadata</name>
                  <manifestEntries>
                    <Build-Revision>${buildNumber}</Build-Revision>
                    <Build-Branch>${scmBranch}</Build-Branch>
                    <Build-Time>${maven.build.timestamp}</Build-Time>
                    <Build-Host>${build.hostname}</Build-Host>
                    <Build-User>${user.name}</Build-User>
                    <Build-Java>${java.version}</Build-Java>
                    <Build-OS>${os.name}</Build-OS>
                    <Package-Vendor>${project.organization.name}</Package-Vendor>
                    <Package-Group>${project.groupId}</Package-Group>
                    <Package-Name>${project.artifactId}</Package-Name>
                    <Package-Version>${project.version}</Package-Version>
                  </manifestEntries>
                </manifestSection>
              </manifestSections>
            </archive>
          </configuration>
        </plugin>

        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>2.5</version>
          <configuration>
            <filesets>
              <fileset>
                <directory>assembly</directory>
                <followSymlinks>false</followSymlinks>
              </fileset>
            </filesets>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.5.2</version>
          <configuration>
            <tagNameFormat>v@{project.version}</tagNameFormat>
            <autoVersionSubmodules>true</autoVersionSubmodules>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-remote-resources-plugin</artifactId>
          <version>1.5</version>
        </plugin>

        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>${license-maven-plugin.version}</version>
          <dependencies>
            <dependency>
              <groupId>com.mycila</groupId>
              <artifactId>license-maven-plugin-git</artifactId>
              <version>${license-maven-plugin.version}</version>
            </dependency>
          </dependencies>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <!-- require java 8 since that's what euphoria requires -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.4.1</version>
        <executions>
          <execution>
            <id>enforce-versions</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireJavaVersion>
                  <version>1.8</version>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- run tests and generate reports -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.18.1</version>
        <configuration>
          <forkCount>1</forkCount>
          <threadCount>1</threadCount>
          <runOrder>hourly</runOrder>
          <argLine>-Xmx512m</argLine>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <!--
      Packages up all the plugins to be executed in "regular" builds. This
      mainly includes running validations, javadoc and source generation,
      and prepare stuff for creating a full fledged jar. active by default.
      You can opt out from this profile to make a very spartan build of the
      artifacts - may speed up things during local development.
     -->
    <profile>
      <id>regular-build</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <plugins>
          <!-- turn compiler warnings into errors -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.3</version>
            <configuration>
              <source>1.8</source>
              <target>1.8</target>
              <encoding>UTF-8</encoding>
              <compilerArgs>
                <arg>-Xlint:unchecked</arg>
                <arg>-Werror</arg>
              </compilerArgs>
            </configuration>
          </plugin>

          <!--  generate and attach sources 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>

          <!-- generate and attache javadoc jar -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <!-- Plugin fetching information for package manifest meta-data -->
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>buildnumber-maven-plugin</artifactId>
            <version>1.3</version>
            <executions>
              <execution>
                <phase>validate</phase>
                <goals>
                  <goal>create</goal>
                </goals>
                <configuration>
                  <doCheck>false</doCheck>
                  <doUpdate>false</doUpdate>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <!-- Plugin fetching information for package manifest meta-data -->
          <plugin>
            <groupId>org.codehaus.gmaven</groupId>
            <artifactId>gmaven-plugin</artifactId>
            <version>1.5</version>
            <executions>
              <execution>
                <phase>generate-resources</phase>
                <goals>
                  <goal>execute</goal>
                </goals>
                <configuration>
                  <source>
                    project.properties["build.hostname"] = InetAddress.getLocalHost().getHostName()
                  </source>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <!-- produce license resources artifacts/jars -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-remote-resources-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>process</goal>
                </goals>
                <configuration>
                  <resourceBundles>
                    <resourceBundle>org.apache:apache-jar-resource-bundle:1.4</resourceBundle>
                  </resourceBundles>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <!-- help managing license headers -->
          <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <configuration>
              <header>license-header.txt</header>
              <properties>
                <owner>Seznam.cz, a.s.</owner>
              </properties>
              <excludes>
                <exclue>cd/**</exclue>
                <exclude>**/.idea/**</exclude>
                <exclude>**/README</exclude>
                <exclude>**/NOTICE</exclude>
                <exclude>**/LICENSE</exclude>
                <exclude>src/test/resources/**</exclude>
                <exclude>src/main/resources/**</exclude>
              </excludes>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>check</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <!-- static analysis of the code using FindBugs -->
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>findbugs-maven-plugin</artifactId>
            <version>3.0.4</version>
            <configuration>
              <effort>max</effort>
              <!-- check only for 'troubling' bugs and worse -->
              <maxRank>14</maxRank>
              <xmlOutput>false</xmlOutput>
              <includeTests>true</includeTests>
            </configuration>
            <executions>
              <execution>
                <phase>process-classes</phase>
                <goals>
                  <goal>check</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>2.4.3</version>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>sign</id>
      <build>
        <plugins>
          <!-- support for signing our artifacts to be deployed -->
          <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>
      </build>
    </profile>
  </profiles>

  <dependencyManagement>
    <dependencies>

      <!-- our own dependencies -->

      <dependency>
        <groupId>cz.seznam.euphoria</groupId>
        <artifactId>euphoria-core</artifactId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <groupId>cz.seznam.euphoria</groupId>
        <artifactId>euphoria-inmem</artifactId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <groupId>cz.seznam.euphoria</groupId>
        <artifactId>euphoria-kafka_0.10</artifactId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <groupId>cz.seznam.euphoria</groupId>
        <artifactId>euphoria-flink</artifactId>
        <version>${project.version}</version>
      </dependency>
      
      <dependency>
        <groupId>cz.seznam.euphoria</groupId>
        <artifactId>euphoria-spark</artifactId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <groupId>cz.seznam.euphoria</groupId>
        <artifactId>euphoria-hadoop</artifactId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <groupId>cz.seznam.euphoria</groupId>
        <artifactId>euphoria-operator-testkit</artifactId>
        <version>${project.version}</version>
        <scope>test</scope>
      </dependency>

      <!-- other dependencies -->

      <dependency>
        <groupId>cz.seznam.euphoria</groupId>
        <artifactId>shaded-guava</artifactId>
        <version>21.0</version>
      </dependency>

      <dependency>
        <groupId>com.google.code.findbugs</groupId>
        <artifactId>jsr305</artifactId>
        <version>1.3.9</version>
      </dependency>

      <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>1.14.8</version>
      </dependency>

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.6.6</version>
      </dependency>

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>1.6.6</version>
      </dependency>

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>log4j-over-slf4j</artifactId>
        <version>1.6.6</version>
      </dependency>

      <dependency>
        <groupId>com.esotericsoftware.kryo</groupId>
        <artifactId>kryo</artifactId>
        <version>2.24.0</version>
      </dependency>

      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.1.2</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.10</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-all</artifactId>
        <version>1.9.5</version>
        <scope>test</scope>
      </dependency>

    </dependencies>
  </dependencyManagement>

  <properties>
    <flink.version>1.2.1</flink.version>
    <spark.version>2.1.0</spark.version>
    <license-maven-plugin.version>3.0</license-maven-plugin.version>
  </properties>

</project>
