<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>
    <parent>
        <!--FIXME: It uses Jenkins Plugin POM, but it should not. It appears to work, but it needs to be fixed ASAP.
            The client cannot be built with 2.36, JAR packaging does not work there (and it should not)
         -->
        <groupId>org.jenkins-ci.plugins</groupId>
        <artifactId>swarm-plugin</artifactId>
        <version>3.7</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>swarm-client</artifactId>
    <packaging>jar</packaging>
    <name>Jenkins Swarm Plugin Client</name>

    <properties>
      <java.level>8</java.level>
    </properties>

    <build>
      <plugins>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>findbugs-maven-plugin</artifactId>
          <executions>
            <execution>
              <phase>none</phase>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>3.0.0</version>
          <executions>
            <execution>
              <phase>package</phase>
              <goals>
                <goal>shade</goal>
              </goals>
              <configuration>
                <createDependencyReducedPom>false</createDependencyReducedPom>
                <filters>
                  <filter>
                    <artifact>*:*</artifact>
                    <excludes>
                      <exclude>META-INF/*.SF</exclude>
                      <exclude>META-INF/*.DSA</exclude>
                      <exclude>META-INF/*.RSA</exclude>
                    </excludes>
                  </filter>
                </filters>
                <relocations>
                  <!-- Be ware! there is org.xxx class in the fwk, do not relocate them! -->
                  <!-- hudson remoting seems to check some class also, so cannot be shaded -->
                  <relocation>
                    <pattern>org.apache</pattern>
                    <shadedPattern>shaded.org.apache</shadedPattern>
                  </relocation>
                  <relocation>
                    <pattern>org.slf4j</pattern>
                    <shadedPattern>shaded.org.slf4j</shadedPattern>
                  </relocation>
                </relocations>
                <transformers>
                  <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                    <manifestEntries>
                      <Main-Class>hudson.plugins.swarm.Client</Main-Class>
                    </manifestEntries>
                  </transformer>
                </transformers>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </build>
    <dependencies>
      <!-- these dependencies need to be explicitly defined so that
           they make it into uberjar (the compilation would pass
           without these because we inherit them from ancestor POM.)
      -->
      <dependency>
        <groupId>args4j</groupId>
        <artifactId>args4j</artifactId>
        <version>2.0.29</version>
      </dependency>
      <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.1.1</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>1.7.22</version>
      </dependency>
      <dependency>
        <groupId>org.jenkins-ci.main</groupId>
        <artifactId>remoting</artifactId>
        <version>3.15</version>
      </dependency>
      <dependency>
        <groupId>commons-httpclient</groupId>
        <artifactId>commons-httpclient</artifactId>
        <version>3.1-jenkins-1</version>
      </dependency>
      <dependency>
        <groupId>commons-codec</groupId>
        <artifactId>commons-codec</artifactId>
        <version>1.9</version>
      </dependency>
      <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.4</version>
      </dependency>
      <dependency>
          <groupId>com.google.code.findbugs</groupId>
          <artifactId>annotations</artifactId>
          <version>3.0.1</version>
          <scope>provided</scope>
      </dependency>
      <dependency>
          <groupId>com.google.code.findbugs</groupId>
          <artifactId>jsr305</artifactId>
          <version>3.0.1</version>
          <scope>provided</scope>
      </dependency>
    </dependencies>
</project>
