<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2019 The Exonum Team
  ~
  ~ 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>com.exonum.binding</groupId>
    <artifactId>exonum-java-binding-parent</artifactId>
    <version>0.9.0-rc2</version>
  </parent>

  <artifactId>exonum-java-app</artifactId>
  <version>0.9.0-rc2</version>
  <packaging>jar</packaging>

  <name>Exonum Java Binding: App</name>
  <description>Exonum Java application allows to bootstrap the Java runtime. It could have
  been a part of core, but remains in a separate module to break the circular dependency
  between the core (runtime configuration requiring time oracle) and the time oracle.

  The classpath of this module includes all of the dependencies of the native application.
  </description>

  <properties>
    <ejb-core.nativeLibPath>${project.parent.basedir}/core/rust/target/debug</ejb-core.nativeLibPath>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.exonum.binding</groupId>
      <artifactId>exonum-java-binding-core</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>com.exonum.binding</groupId>
      <artifactId>exonum-time-oracle</artifactId>
      <version>${project.version}</version>
    </dependency>

    <!-- Use Log4J 2 as the backend -->
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
    </dependency>

    <!-- One of our dependencies uses SLF4J (PF4J). This SLF4J binding allows
         applications coded to the SLF4J API to use Log4j 2 as the implementation. -->
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-slf4j18-impl</artifactId>
    </dependency>

    <dependency>
      <groupId>com.exonum.binding</groupId>
      <artifactId>exonum-java-testing</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <configuration>
          <configLocation>${project.parent.basedir}/../checkstyle.xml</configLocation>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>create-build-metadata</id>
            <goals>
              <goal>create-metadata</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <addOutputDirectoryToResources>true</addOutputDirectoryToResources>
          <shortRevisionLength>8</shortRevisionLength>
          <timezone>UTC</timezone>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <argLine>
            ${jacoco.args}
            -Djava.library.path=${ejb-core.nativeLibPath}
            ${java.vm.assertionFlag}
          </argLine>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
</project>
