<?xml version="1.0" encoding="UTF-8"?>
<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>
    <groupId>org.jenkins-ci.plugins</groupId>
    <artifactId>plugin</artifactId>
    <version>4.88</version>
    <relativePath />
  </parent>

  <artifactId>anchore-container-scanner</artifactId>
  <version>3.3.0</version>
  <packaging>hpi</packaging>
  <name>Anchore Container Image Scanner Plugin</name>
  <description>Integrates Jenkins with the Anchore Image Scanner</description>

  <url>https://github.com/jenkinsci/anchore-container-scanner-plugin</url>

  <licenses>
    <license>
      <name>Apache 2 License</name>
      <url>http://opensource.org/licenses/Apache-2.0</url>
    </license>
  </licenses>

  <properties>
    <!-- Baseline Jenkins version you use to build the plugin. Users must have this version or newer to run. -->
    <jenkins.version>2.462.3</jenkins.version>
    <!-- Java Level to use. Java 8 required when using core >= 1.612 -->
    <java.level>8</java.level>
    <!-- Jenkins Test Harness version you use to test the plugin. -->
    <!-- For Jenkins version >= 1.580.1 use JTH 2.x or higher. -->
    <!-- Other properties you may want to use:
         ~ hpi-plugin.version: The HPI Maven Plugin version used by the plugin..
         ~ stapler-plugin.version: The Stapler Maven plugin version required by the plugin.
    -->
  </properties>

  <developers>
    <developer>
      <id>nurmi</id>
      <name>Daniel Nurmi</name>
      <email>nurmi@anchore.com</email>
    </developer>
    <developer>
      <id>swathigangisetty</id>
      <name>Swathi Gangisetty</name>
      <email>swathi@anchore.com</email>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git://github.com/jenkinsci/${project.artifactId}-plugin.git</connection>
    <developerConnection>scm:git:git@github.com:jenkinsci/${project.artifactId}-plugin.git</developerConnection>
    <url>http://github.com/jenkinsci/${project.artifactId}-plugin</url>
    <tag>anchore-container-scanner-3.3.0</tag>
  </scm>
  <!--
    <scm>
      <connection>scm:git:https://github.com/jenkinsci/${project.artifactId}-plugin.git</connection>
      <developerConnection>scm:git:https://git@github.com/jenkinsci/${project.artifactId}-plugin.git</developerConnection>
      <url>http://github.com/jenkinsci/${project.artifactId}-plugin</url>
      <tag>HEAD</tag>
    </scm>
  -->
  <repositories>
    <repository>
      <id>repo.jenkins-ci.org</id>
      <url>https://repo.jenkins-ci.org/public/</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>repo.jenkins-ci.org</id>
      <url>https://repo.jenkins-ci.org/public/</url>
    </pluginRepository>
  </pluginRepositories>
  <!-- If you want to depend on other plugins -->
  <dependencies>
    <!--
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>credentials</artifactId>
      <version>1.9.4</version>
    </dependency>
    -->
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>structs</artifactId>
      <version>338.v848422169819</version>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <version>4.5.14</version>
    </dependency>
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>credentials</artifactId>
      <version>1381.v2c3a_12074da_b_</version>
    </dependency>
  </dependencies>

  <!--
                  <artifactItem>
                    <groupId>org.apache.httpcomponents</groupId>
                    <artifactId>httpclient</artifactId>
                    <version>4.5.3</version>
                  </artifactItem>
                  <artifactItem>
                    <groupId>org.apache.httpcomponents</groupId>
                    <artifactId>httpcore</artifactId>
                    <version>4.4.6</version>
                  </artifactItem>
  -->

  <build>
    <plugins>

      <!-- download external resources like jQuery, jQuery UI, datatable etc. via webjars -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>download-webresources</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.webjars</groupId>
                  <artifactId>jquery</artifactId>
                  <version>1.12.4</version>
                  <includes>**/jquery*.min.js</includes>
                </artifactItem>
                <artifactItem>
                  <groupId>org.webjars</groupId>
                  <artifactId>datatables</artifactId>
                  <version>1.10.25</version>
                  <includes>
                    **/jquery.dataTables.min.js,**/dataTables.bootstrap.min.js,**/dataTables.bootstrap.min.css
                  </includes>
                </artifactItem>
                <artifactItem>
                  <groupId>org.webjars</groupId>
                  <artifactId>bootstrap</artifactId>
                  <version>3.4.1</version>
                  <includes>**/bootstrap.min.css,**/bootstrap.min.js,**/fonts/*</includes>
                </artifactItem>
              </artifactItems>
              <outputDirectory>${project.build.directory}/webjars</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- copy downloaded resources to target/external-resources -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-downloaded-resources</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/external-resources</outputDirectory>
              <resources>
                <resource>
                  <targetPath>js</targetPath>
                  <directory>${project.build.directory}/webjars/META-INF/resources/webjars/jquery/1.12.4</directory>
                </resource>
                <resource>
                  <directory>${project.build.directory}/webjars/META-INF/resources/webjars/datatables/1.10.25</directory>
                </resource>
                <resource>
                  <directory>${project.build.directory}/webjars/META-INF/resources/webjars/bootstrap/3.4.1</directory>
                </resource>
                <!-- also copy existing resources to use them in the HPL for testing -->
                <resource>
                  <directory>src/main/webapp</directory>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- include downloaded resources in HPI -->
      <plugin>
        <groupId>org.jenkins-ci.tools</groupId>
        <artifactId>maven-hpi-plugin</artifactId>
        <configuration>
          <minimumJavaVersion>8</minimumJavaVersion>
          <webResources>
            <webResource>
              <directory>${project.build.directory}/external-resources</directory>
              <filtering>false</filtering>
            </webResource>
          </webResources>
          <!-- for testing -->
          <warSourceDirectory>${project.build.directory}/external-resources</warSourceDirectory>
        </configuration>
      </plugin>
    </plugins>

  </build>

</project>
