<?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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.secnod.dropwizard</groupId>
  <artifactId>dropwizard-shiro</artifactId>
  <version>0.3.0</version>

  <name>${project.groupId}:${project.artifactId}</name>
  <description>A Dropwizard bundle for Apache Shiro.</description>
  <url>https://github.com/silb/dropwizard-shiro</url>

  <licenses>
    <license>
      <name>Apache License 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Stig Inge Lea Bjørnsen</name>
      <email>stiginge@pvv.org</email>
      <url>http://blog.silb.no</url>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:https://github.com/silb/dropwizard-shiro.git</connection>
    <developerConnection>scm:git:git@github.com:silb/dropwizard-shiro.git</developerConnection>
    <tag>v0.3.0</tag>
    <url>https://github.com/silb/dropwizard-shiro</url>
  </scm>

  <issueManagement>
    <url>https://github.com/silb/dropwizard-shiro/issues</url>
  </issueManagement>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <dependencies>
    <dependency>
      <groupId>io.dropwizard</groupId>
      <artifactId>dropwizard-core</artifactId>
      <version>${dropwizard.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.dropwizard</groupId>
      <artifactId>dropwizard-jersey</artifactId>
      <version>${dropwizard.version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.shiro</groupId>
      <artifactId>shiro-web</artifactId>
      <version>${shiro.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.shiro</groupId>
      <artifactId>shiro-jaxrs</artifactId>
      <version>${shiro.version}</version>
    </dependency>
    <dependency>
      <groupId>org.secnod.shiro</groupId>
      <artifactId>shiro-jersey</artifactId>
      <version>${shiro-jersey.version}</version>
      <exclusions>
        <exclusion>
          <!-- Provided by Dropwizard -->
          <groupId>org.glassfish.jersey.core</groupId>
          <artifactId>jersey-server</artifactId>
        </exclusion>
        <exclusion>
          <!-- Provided by Dropwizard -->
          <groupId>org.glassfish.jersey.containers</groupId>
          <artifactId>jersey-container-servlet</artifactId>
        </exclusion>
        <!-- Provided by Dropwizard -->
        <exclusion>
          <groupId>org.glassfish.jersey.inject</groupId>
          <artifactId>jersey-hk2</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.secnod.shiro</groupId>
      <artifactId>shiro-jersey</artifactId>
      <version>${shiro-jersey.version}</version>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>

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

    <dependency>
      <groupId>io.dropwizard</groupId>
      <artifactId>dropwizard-testing</artifactId>
      <version>${dropwizard.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.glassfish.jersey.core</groupId>
      <artifactId>jersey-client</artifactId>
      <version>${jersey.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.connectors</groupId>
      <artifactId>jersey-apache-connector</artifactId>
      <version>${jersey.version}</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <dropwizard.version>2.1.7</dropwizard.version>
    <shiro.version>1.4.2</shiro.version>
    <shiro-jersey.version>0.3.0</shiro-jersey.version>
    <jdk.version>1.8</jdk.version>
    <jersey.version>2.39.1</jersey.version>
  </properties>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.8</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
          <source>${jdk.version}</source>
          <target>${jdk.version}</target>
          <verbose>true</verbose>
          <compilerArgument>-Xlint</compilerArgument>
          <showWarnings>true</showWarnings>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.3.1</version>
        <executions>
          <execution>
            <id>enforce-versions</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireJavaVersion>
                  <version>[${jdk.version},1.9]</version>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.1.2</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.2.1</version>
        <executions>
          <execution>
            <goals>
              <goal>exec</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <executable>java</executable>
          <classpathScope>test</classpathScope>
          <arguments>
            <argument>-classpath</argument>
            <classpath />
            <argument>org.secnod.dropwizard.shiro.test.integration.ApiApplication</argument>
          </arguments>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.16</version>
        <configuration>
          <excludes>
            <exclude>**/test/integration/**/*Test.java</exclude>
          </excludes>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <version>2.8</version>
        <configuration>
          <downloadSources>true</downloadSources>
          <downloadJavadocs>true</downloadJavadocs>
          <classpathContainers>
            <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-${jdk.version}</classpathContainer>
          </classpathContainers>
        </configuration>
      </plugin>

      <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-release-plugin</artifactId>
       <version>2.4.2</version>
       <dependencies>
        <dependency>
          <groupId>org.apache.maven.scm</groupId>
          <artifactId>maven-scm-provider-gitexe</artifactId>
          <version>1.8.1</version>
        </dependency>
       </dependencies>
       <configuration>
         <tagNameFormat>v@{project.version}</tagNameFormat>
         <useReleaseProfile>false</useReleaseProfile>
         <releaseProfiles>release</releaseProfiles>
       </configuration>
     </plugin>

     <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-javadoc-plugin</artifactId>
       <configuration>
         <links>
           <link>https://jersey.java.net/apidocs/${jersey.version}/jersey/</link>
           <link>http://shiro.apache.org/static/${shiro.version}/apidocs/</link>
           <link>http://dropwizard.io/${dropwizard.version}/dropwizard-core/apidocs/</link>
         </links>
       </configuration>
     </plugin>

    </plugins>
  </build>

  <profiles>

    <profile>
      <!-- Run the integration tests as part of the build. -->
      <id>integration-tests</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.16</version>
            <configuration>
              <includes>
                <include>**/test/integration/IntegrationTestSuite.java</include>
              </includes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>release</id>
      <build>
        <plugins>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.5</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

        </plugins>
      </build>
    </profile>

    <profile>
      <!-- Configure the Eclipse Infinitest plugin to ignore integration tests. -->
      <id>infinitest</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-eclipse-plugin</artifactId>
            <version>2.8</version>
            <configuration>
              <additionalConfig>
                <file>
                  <name>infinitest.filters</name>
                  <content>
                  <![CDATA[
                  .*\.test\.integration\..*]]>
                  </content>
                </file>
              </additionalConfig>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

  </profiles>

</project>
