<?xml version="1.0"?>
<!--
  ~ Copyright (c) 2011-2014 The original author or authors
  ~
  ~  All rights reserved. This program and the accompanying materials
  ~  are made available under the terms of the Eclipse Public License v1.0
  ~  and Apache License v2.0 which accompanies this distribution.
  ~
  ~      The Eclipse Public License is available at
  ~      http://www.eclipse.org/legal/epl-v10.html
  ~
  ~      The Apache License v2.0 is available at
  ~      http://www.opensource.org/licenses/apache2.0.php
  ~
  ~  You may elect to redistribute this code under either of these licenses.
  --><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>io.vertx</groupId>
    <artifactId>vertx-ext-parent</artifactId>
    <version>42</version>
  </parent>

  <artifactId>vertx-http-proxy</artifactId>
  <version>4.5.22</version>

  <name>Vert.x Http Proxy</name>

  <scm>
    <connection>scm:git:git@github.com:eclipse-vertx/vertx-http-proxy.git</connection>
    <developerConnection>scm:git:git@github.com:eclipse-vertx/vertx-http-proxy.git</developerConnection>
    <url>git@github.com:eclipse-vertx/vertx-http-proxy.git</url>
  </scm>

  <properties>
    <fatjar.dir>${project.build.directory}</fatjar.dir>
    <doc.skip>false</doc.skip>
    <jar.manifest>${project.basedir}/src/main/resources/META-INF/MANIFEST.MF</jar.manifest>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.vertx</groupId>
        <artifactId>vertx-dependencies</artifactId>
        <version>${project.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-core</artifactId>
    </dependency>

    <!-- Only for fatjar -->
    <dependency>
      <!-- declare this dependency to force shiro to use this one. It is the version used by vert.x -->
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.16</version>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-docgen</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-codegen</artifactId>
      <scope>provided</scope>
    </dependency>

<!--
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>1.0.13</version>
    </dependency>
-->

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-unit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.github.tomakehurst</groupId>
      <artifactId>wiremock-standalone</artifactId>
      <version>2.6.0</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>

    <plugins>
      <!-- Copy resources after compilation phase as we generate JS in src/main/resources -->
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>default-resources</id>
            <phase>process-classes</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <failIfNoTests>false</failIfNoTests>
          <systemPropertyVariables>
            <vertx.test.dir>${project.build.directory}</vertx.test.dir>
            <vertx.test.timeout>60</vertx.test.timeout>
            <io.netty.leakDetectionLevel>PARANOID</io.netty.leakDetectionLevel>
          </systemPropertyVariables>
          <argLine>-server -Xms128m -Xmx1024m -XX:NewRatio=2</argLine>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>default-jar</id>
            <phase>process-classes</phase>
            <configuration>
              <archive>
                <manifestEntries>
                  <Main-Verticle>service:io.vertx.ext.shell</Main-Verticle>
                </manifestEntries>
              </archive>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>2.3</version>
        <executions>
          <!-- Run shade goal on package phase -->
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                  </excludes>
                </filter>
              </filters>
              <outputDirectory>${fatjar.dir}</outputDirectory>
              <finalName>${project.artifactId}-${project.version}-fat</finalName>
              <transformers>
                <!-- add Main-Class to manifest file -->
                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                  <mainClass>io.vertx.httpproxy.Main</mainClass>
                </transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>

    </plugins>
    <pluginManagement>
      <plugins>

        <!-- Execute with mvn java:exec -->
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>1.3.2</version>
          <configuration>
            <mainClass>io.vertx.ext.shell.Main</mainClass>
            <classpathScope>test</classpathScope>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>
