<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (c) 2018-present Sonatype, Inc. All rights reserved.

    This program is licensed to you under the Apache License Version 2.0,
    and you may not use this file except in compliance with the Apache License Version 2.0.
    You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.

    Unless required by applicable law or agreed to in writing,
    software distributed under the Apache License Version 2.0 is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.

-->
<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.sonatype.buildsupport</groupId>
    <artifactId>public-parent</artifactId>
    <version>13</version>
  </parent>

  <groupId>org.sonatype.goodies</groupId>
  <artifactId>package-url-java</artifactId>
  <name>${project.groupId}:${project.artifactId}</name>
  <packaging>jar</packaging>

  <version>1.1.1</version>

  <url>https://sonatype.github.io/package-url-java/</url>

  <scm>
    <connection>scm:git:git://github.com/sonatype/package-url-java.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/sonatype/package-url-java.git</developerConnection>
    <url>https://github.com/sonatype/package-url-java</url>
  </scm>

  <inceptionYear>2018</inceptionYear>

  <licenses>
    <license>
      <name>ASL2</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <issueManagement>
    <system>github</system>
    <url>https://github.com/sonatype/package-url-java/issues</url>
  </issueManagement>

  <ciManagement>
    <system>jenkins</system>
    <url>https://jenkins.zion.aws.s/job/goodies/job/package-url-java</url>
  </ciManagement>

  <distributionManagement>
    <site>
      <id>sonatype-ghpages</id>
      <url>scm:git:ssh://git@github.com/sonatype/package-url-java.git</url>
    </site>
  </distributionManagement>

  <properties>
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>

    <dionysus.version>1.0.3</dionysus.version>
  </properties>

  <dependencies>
    <!-- Guava 20.x is the latest which supports Java 1.7 -->
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>20.0</version>
    </dependency>

    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <version>3.0.2</version>
      <optional>true</optional>
    </dependency>

    <!-- support for Jackson [de]serializer -->
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>2.9.10</version>
      <optional>true</optional>
    </dependency>

    <!-- support for JAX-RS parameter converter -->
    <dependency>
      <groupId>javax.ws.rs</groupId>
      <artifactId>javax.ws.rs-api</artifactId>
      <version>2.0.1</version>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>org.sonatype.goodies</groupId>
      <artifactId>goodies-testsupport</artifactId>
      <version>2.2.4</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-all</artifactId>
      <version>2.4.11</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.0.1</version>
          <configuration>
            <source>${maven.compiler.source}</source>
            <additionalOptions>
              <!-- Turn off strict javadoc checks in Java-8 -->
              <option>-Xdoclint:none</option>
            </additionalOptions>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-invoker-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>

        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <configuration>
            <excludes combine.children="append">
              <exclude>src/test/resources/**</exclude>
              <exclude>src/site/hugo/**</exclude>
            </excludes>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.sonatype.goodies.dionysus</groupId>
          <artifactId>dionysus-maven-plugin</artifactId>
          <version>${dionysus.version}</version>
          <configuration>
            <theme>
              <groupId>org.sonatype.goodies.dionysus</groupId>
              <artifactId>dionysus-hugo-theme</artifactId>
              <version>${dionysus.version}</version>
            </theme>
            <mavenGoals>
              <goal>javadoc:aggregate</goal>
              <goal>jxr:aggregate</goal>
            </mavenGoals>
            <generators>
              <mavenLicenses/>
              <mavenModules/>
              <mavenPom/>
            </generators>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <dependencies>
          <dependency>
            <groupId>org.owasp.maven.enforcer</groupId>
            <artifactId>class-file-format-rule</artifactId>
            <version>1.0.0</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>checks</id>
            <phase>validate</phase>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>[3.3,)</version>
                </requireMavenVersion>
                <requireJavaVersion>
                  <version>[1.7,)</version>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>
          <execution>
            <id>enforce-classfileformat</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <byteCodeRule implementation="org.owasp.maven.enforcer.rule.ClassFileFormatRule">
                  <supportedClassFileFormat>51</supportedClassFileFormat>
                </byteCodeRule>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>animal-sniffer-maven-plugin</artifactId>
        <configuration>
          <signature>
            <groupId>org.codehaus.mojo.signature</groupId>
            <artifactId>java17</artifactId>
            <version>1.0</version>
          </signature>
        </configuration>
        <executions>
          <execution>
            <phase>test</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <dependencies>
          <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-eclipse-compiler</artifactId>
            <version>2.9.2-01</version>
          </dependency>
          <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-eclipse-batch</artifactId>
            <version>2.4.3-01</version>
          </dependency>
        </dependencies>
        <configuration>
          <compilerId>groovy-eclipse-compiler</compilerId>
        </configuration>
      </plugin>

      <plugin>
        <groupId>com.sonatype.clm</groupId>
        <artifactId>clm-maven-plugin</artifactId>
        <version>2.8.1-01</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>index</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>it</id>
      <activation>
        <property>
          <name>it</name>
          <value>true</value>
        </property>
      </activation>

      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
