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

    Copyright (c) 2010-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>9</version>
    <relativePath/>
  </parent>

  <groupId>org.sonatype.goodies</groupId>
  <artifactId>goodies</artifactId>
  <name>${project.groupId}:${project.artifactId}</name>
  <packaging>pom</packaging>
  <version>2.2.4</version>

  <url>https://github.com/sonatype/goodies</url>
  <inceptionYear>2010</inceptionYear>

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

  <issueManagement>
    <system>github</system>
    <url>https://github.com/sonatype/goodies/issues</url>
  </issueManagement>

  <prerequisites>
    <maven>3.0.4</maven>
  </prerequisites>

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

    <slf4j.version>1.7.10</slf4j.version>
    <sisu-guice.version>3.2.5</sisu-guice.version>
    <powermock.version>1.6.1</powermock.version>
    <eclipse-sisu.version>0.3.1</eclipse-sisu.version>
    <eclipse-jetty.version>9.3.3.v20150827</eclipse-jetty.version>

    <!--
    Sonar configuration.
    -->
    <sonar.branch>2</sonar.branch>
  </properties>

  <modules>
    <module>common</module>
    <module>httpfixture</module>
    <module>i18n</module>
    <module>lifecycle</module>
    <module>testsupport</module>
    <module>prefs</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>log4j-over-slf4j</artifactId>
        <version>${slf4j.version}</version>
      </dependency>

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>${slf4j.version}</version>
      </dependency>

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>${slf4j.version}</version>
      </dependency>

      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-core</artifactId>
        <version>1.1.2</version>
      </dependency>

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

      <dependency>
        <groupId>org.sonatype.gossip</groupId>
        <artifactId>gossip-bootstrap</artifactId>
        <version>1.8</version>
      </dependency>

      <dependency>
        <groupId>org.sonatype.gossip</groupId>
        <artifactId>gossip-support</artifactId>
        <version>1.8</version>
      </dependency>

      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>18.0</version>
      </dependency>

      <dependency>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>animal-sniffer-annotations</artifactId>
        <version>1.14</version>
      </dependency>

      <dependency>
        <groupId>javax.inject</groupId>
        <artifactId>javax.inject</artifactId>
        <version>1</version>
      </dependency>

      <dependency>
        <groupId>org.eclipse.sisu</groupId>
        <artifactId>org.eclipse.sisu.inject</artifactId>
        <version>${eclipse-sisu.version}</version>
      </dependency>

      <dependency>
        <groupId>org.sonatype.sisu</groupId>
        <artifactId>sisu-guice</artifactId>
        <version>${sisu-guice.version}</version>
      </dependency>

      <dependency>
        <groupId>org.sonatype.sisu.inject</groupId>
        <artifactId>guice-assistedinject</artifactId>
        <version>${sisu-guice.version}</version>
      </dependency>

      <dependency>
        <groupId>org.sonatype.sisu.inject</groupId>
        <artifactId>guice-multibindings</artifactId>
        <version>${sisu-guice.version}</version>
      </dependency>

      <dependency>
        <groupId>org.sonatype.sisu.inject</groupId>
        <artifactId>guice-servlet</artifactId>
        <version>${sisu-guice.version}</version>
      </dependency>

      <dependency>
        <groupId>com.google.code.findbugs</groupId>
        <artifactId>jsr305</artifactId>
        <version>2.0.1</version>
      </dependency>

      <dependency>
        <groupId>com.thoughtworks.xstream</groupId>
        <artifactId>xstream</artifactId>
        <version>1.4.7</version>
      </dependency>

      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
      </dependency>

      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-core</artifactId>
        <version>1.3</version>
      </dependency>

      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-library</artifactId>
        <version>1.3</version>
      </dependency>

      <dependency>
        <groupId>org.incava</groupId>
        <artifactId>java-diff</artifactId>
        <version>1.1</version>
      </dependency>

      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>1.9.5</version>
      </dependency>

      <dependency>
        <groupId>org.powermock</groupId>
        <artifactId>powermock-module-junit4</artifactId>
        <version>${powermock.version}</version>
      </dependency>

      <dependency>
        <groupId>org.powermock</groupId>
        <artifactId>powermock-api-mockito</artifactId>
        <version>${powermock.version}</version>
        <exclusions>
          <exclusion>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <dependency>
        <groupId>org.powermock</groupId>
        <artifactId>powermock-module-junit4-rule</artifactId>
        <version>${powermock.version}</version>
      </dependency>

      <dependency>
        <groupId>org.powermock</groupId>
        <artifactId>powermock-classloading-xstream</artifactId>
        <version>${powermock.version}</version>
      </dependency>

      <!-- mockito-core and powermock-reflect depend on different versions of objenesis, force newest -->
      <dependency>
        <groupId>org.objenesis</groupId>
        <artifactId>objenesis</artifactId>
        <version>1.3</version>
      </dependency>

      <dependency>
        <groupId>org.easytesting</groupId>
        <artifactId>fest-assert-core</artifactId>
        <version>2.0M10</version>
      </dependency>

      <dependency>
        <groupId>org.databene</groupId>
        <artifactId>contiperf</artifactId>
        <version>2.2.0</version>
      </dependency>

      <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>1.2.2</version>
      </dependency>

      <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-guice</artifactId>
        <version>1.2.2</version>
      </dependency>

      <dependency>
        <groupId>com.github.tomakehurst</groupId>
        <artifactId>wiremock</artifactId>
        <version>1.38</version> <!-- Later versions depend on Jackson 2.4, so we'd need to update too -->
        <exclusions>
          <exclusion>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
          </exclusion>
          <exclusion>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
          </exclusion>
          <exclusion>
            <groupId>junit</groupId>
            <artifactId>junit-dep</artifactId>
          </exclusion>
          <exclusion>
            <groupId>net.sf.jopt-simple</groupId>
            <artifactId>jopt-simple</artifactId>
          </exclusion>
          <exclusion>
            <groupId>com.jayway.jsonpath</groupId>
            <artifactId>json-path</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <dependency>
        <groupId>org.apache.directory.server</groupId>
        <artifactId>apacheds-test-framework</artifactId>
        <version>2.0.0-M19</version>
        <exclusions>
          <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.apache.directory.server</groupId>
            <artifactId>apacheds-jdbm-partition</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.apache.directory.jdbm</groupId>
            <artifactId>apacheds-jdbm1</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-servlet</artifactId>
        <version>${eclipse-jetty.version}</version>
      </dependency>

      <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-security</artifactId>
        <version>${eclipse-jetty.version}</version>
      </dependency>

      <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-webapp</artifactId>
        <version>${eclipse-jetty.version}</version>
      </dependency>

      <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-proxy</artifactId>
        <version>${eclipse-jetty.version}</version>
      </dependency>
      
      <dependency>
        <groupId>org.littleshoot</groupId>
        <artifactId>littleproxy</artifactId>
        <version>1.1.0</version>
      </dependency>
      
      <!-- INTERNAL (DO NOT USE ${project.version}) -->

      <dependency>
        <groupId>org.sonatype.goodies</groupId>
        <artifactId>goodies-common</artifactId>
        <version>2.2.4</version>
      </dependency>

      <dependency>
        <groupId>org.sonatype.goodies</groupId>
        <artifactId>goodies-httpfixture</artifactId>
        <version>2.2.4</version>
      </dependency>

      <dependency>
        <groupId>org.sonatype.goodies</groupId>
        <artifactId>goodies-i18n</artifactId>
        <version>2.2.4</version>
      </dependency>

      <dependency>
        <groupId>org.sonatype.goodies</groupId>
        <artifactId>goodies-lifecycle</artifactId>
        <version>2.2.4</version>
      </dependency>

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

      <dependency>
        <groupId>org.sonatype.goodies</groupId>
        <artifactId>goodies-prefs</artifactId>
        <version>2.2.4</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>checks</id>
            <phase>validate</phase>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>[3.0.4,)</version>
                </requireMavenVersion>
                <requireJavaVersion>
                  <version>[1.7,)</version>
                </requireJavaVersion>
                <bannedDependencies>
                  <searchTransitive>true</searchTransitive>
                  <excludes>
                    <!-- Keep old junit out -->
                    <exclude>junit:junit:(,4.10]</exclude>
                    <exclude>junit:junit-dep</exclude>

                    <!-- Keep all JCL out, use jcl-over-slf4j instead -->
                    <exclude>commons-logging:commons-logging</exclude>
                    <exclude>commons-logging:commons-logging-api</exclude>
                  </excludes>
                </bannedDependencies>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>

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

      <plugin>
        <groupId>org.eclipse.sisu</groupId>
        <artifactId>sisu-maven-plugin</artifactId>
        <version>${eclipse-sisu.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>main-index</goal>
              <goal>test-index</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <!-- relax range to account for guava versioning -->
            <_consumer-policy>$(version;==)</_consumer-policy>
            <!-- include all content in the output directory -->
            <Include-Resource>
              /=${project.build.outputDirectory},{maven-resources}
            </Include-Resource>
          </instructions>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <additionalparam>-Xdoclint:none</additionalparam>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>it</id>
      <activation>
        <property>
          <name>it</name>
        </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>
