<?xml version="1.0" encoding="UTF-8"?>
<!--
  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. See accompanying LICENSE file.
-->
<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>
    <artifactId>ratis</artifactId>
    <groupId>org.apache.ratis</groupId>
    <version>1.0.0</version>
  </parent>

  <artifactId>ratis-examples</artifactId>
  <name>Apache Ratis Examples</name>

  <dependencies>
    <dependency>
      <groupId>org.apache.ratis</groupId>
      <artifactId>ratis-thirdparty-misc</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.ratis</groupId>
      <artifactId>ratis-proto</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.ratis</groupId>
      <artifactId>ratis-tools</artifactId>
    </dependency>

    <dependency>
      <artifactId>ratis-common</artifactId>
      <groupId>org.apache.ratis</groupId>
    </dependency>
    <dependency>
      <artifactId>ratis-common</artifactId>
      <groupId>org.apache.ratis</groupId>
      <scope>test</scope>
      <type>test-jar</type>
    </dependency>

    <dependency>
      <artifactId>ratis-client</artifactId>
      <groupId>org.apache.ratis</groupId>
    </dependency>

    <dependency>
      <artifactId>ratis-server</artifactId>
      <groupId>org.apache.ratis</groupId>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.5</version>
    </dependency>
    <dependency>
      <artifactId>ratis-server</artifactId>
      <groupId>org.apache.ratis</groupId>
      <scope>test</scope>
      <type>test-jar</type>
    </dependency>

    <dependency>
      <artifactId>ratis-hadoop</artifactId>
      <groupId>org.apache.ratis</groupId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <artifactId>ratis-hadoop</artifactId>
      <groupId>org.apache.ratis</groupId>
      <scope>test</scope>
      <type>test-jar</type>
    </dependency>

    <dependency>
      <artifactId>ratis-grpc</artifactId>
      <groupId>org.apache.ratis</groupId>
    </dependency>
    <dependency>
      <artifactId>ratis-grpc</artifactId>
      <groupId>org.apache.ratis</groupId>
      <scope>test</scope>
      <type>test-jar</type>
    </dependency>

    <dependency>
      <artifactId>ratis-netty</artifactId>
      <groupId>org.apache.ratis</groupId>
    </dependency>
    <dependency>
      <artifactId>ratis-netty</artifactId>
      <groupId>org.apache.ratis</groupId>
      <scope>test</scope>
      <type>test-jar</type>
    </dependency>

    <dependency>
      <groupId>com.beust</groupId>
      <artifactId>jcommander</artifactId>
    </dependency>

    <dependency>
       <groupId>io.dropwizard.metrics</groupId>
       <artifactId>metrics-jvm</artifactId>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
    </dependency>


    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <transformers>
                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                  <mainClass>org.apache.ratis.examples.common.Runner</mainClass>
                </transformer>
              </transformers>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exlcude>META-INF/*.SF</exlcude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <configuration>
          <canUpdateCopyright>false</canUpdateCopyright>
          <roots>
            <root>${project.basedir}</root>
          </roots>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.coderplus.maven.plugins</groupId>
        <artifactId>copy-rename-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-file</id>
            <phase>package</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <sourceFile>target/${project.artifactId}-${project.version}-shaded.jar</sourceFile>
              <destinationFile>target/${project.artifactId}-${project.version}.jar</destinationFile>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
