<?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.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>9</version>
  </parent>

  <groupId>org.pac4j</groupId>
  <artifactId>lagom-pac4j-parent</artifactId>
  <packaging>pom</packaging>
  <name>pac4j parent for Lagom</name>
  <version>2.2.0</version>
  <url>https://github.com/pac4j/lagom-pac4j</url>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <scm>
    <url>http://github.com/pac4j/lagom-pac4j.git</url>
    <connection>scm:git:git@github.com:pac4j/lagom-pac4j.git</connection>
    <developerConnection>scm:git:git@github.com:pac4j/lagom-pac4j.git</developerConnection>
    <tag>v2.2.0</tag>
  </scm>

  <developers>
    <developer>
      <id>leleuj</id>
      <name>Jerome LELEU</name>
      <email>leleuj@gmail.com</email>
    </developer>
  </developers>

  <properties>
    <pac4j.version>3.7.0</pac4j.version>
    <lagom15.version>1.5.4</lagom15.version>
    <lagom16.version>1.6.0</lagom16.version>
    <java.version>1.8</java.version>
    <junit.jupiter.version>5.3.1</junit.jupiter.version>
    <assertj.version>3.11.1</assertj.version>
    <jackson.version>2.9.4</jackson.version>
    <scalatest.version>3.0.8</scalatest.version>
    <macwire.version>2.3.3</macwire.version>
    <nimbus-jose-jwt.version>7.9</nimbus-jose-jwt.version>
  </properties>

  <modules>
    <module>lagom-pac4j_2.11</module>
    <module>lagom-pac4j_2.12</module>
    <module>lagom-pac4j_2.13</module>
  </modules>

  <dependencies>
    <dependency>
      <groupId>org.pac4j</groupId>
      <artifactId>pac4j-core</artifactId>
      <version>${pac4j.version}</version>
    </dependency>
    <!-- provided -->
    <dependency>
      <groupId>org.pac4j</groupId>
      <artifactId>pac4j-jwt</artifactId>
      <version>${pac4j.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.nimbusds</groupId>
      <artifactId>nimbus-jose-jwt</artifactId>
      <version>${nimbus-jose-jwt.version}</version>
      <scope>provided</scope>
    </dependency>
    <!-- tests -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>${junit.jupiter.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>${assertj.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.pac4j</groupId>
      <artifactId>pac4j-http</artifactId>
      <version>${pac4j.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
      <version>${jackson.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.0</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.0.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.0.1</version>
        <configuration>
          <charset>UTF-8</charset>
          <encoding>UTF-8</encoding>
          <docencoding>UTF-8</docencoding>
          <links>
            <link>https://pac4j.github.io/pac4j/apidocs/pac4j/${pac4j.version}/</link>
            <link>https://www.lagomframework.com/documentation/1.4.x/java/api/</link>
          </links>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.scala-tools</groupId>
        <artifactId>maven-scala-plugin</artifactId>
        <version>2.15.2</version>
        <configuration>
          <includes>
            <include>**/*.scala</include>
          </includes>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
              <goal>testCompile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
        <version>3.0.5</version>
        <configuration>
          <effort>Low</effort>
          <threshold>Max</threshold>
          <failOnError>true</failOnError>
          <excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
          <includeTests>true</includeTests>
        </configuration>
        <executions>
          <execution>
            <id>run-findbugs</id>
            <phase>compile</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>3.10.0</version>
        <configuration>
          <includeTests>true</includeTests>
          <printFailingErrors>true</printFailingErrors>
        </configuration>
        <executions>
          <execution>
            <id>run-pmd</id>
            <phase>compile</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.22.1</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5.3</version>
        <configuration>
          <tagNameFormat>v@{project.version}</tagNameFormat>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release-sign-artifacts</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
