<?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>com.github.dannil</groupId>
  <artifactId>scb-java-client</artifactId>
  <version>1.2.0</version>
  <packaging>jar</packaging>

  <name>scb-java-client</name>
  <description>Java client for the SCB (Statistiska centralbyrån) API</description>
  <url>https://github.com/dannil/scb-java-client</url>

  <developers>
    <developer>
      <id>dannil</id>
      <name>Daniel Nilsson</name>
      <email>daniel.nilsson94@outlook.com</email>
      <roles>
        <role>architect</role>
        <role>developer</role>
      </roles>
      <timezone>Europe/Stockholm</timezone>
    </developer>
  </developers>

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

  <scm>
    <url>https://github.com/dannil/scb-java-client</url>
    <connection>scm:git:git://github.com/dannil/scb-java-client.git</connection>
    <developerConnection>scm:git:git@github.com:dannil/scb-java-client.git</developerConnection>
    <tag>v1.2.0</tag>
  </scm>
  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/dannil/scb-java-client/issues</url>
  </issueManagement>
  <ciManagement>
    <system>Travis CI</system>
    <url>https://travis-ci.org/dannil/scb-java-client</url>
  </ciManagement>

  <properties>
    <!-- General configuration -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <project.java.source>1.8</project.java.source>
    <project.java.target>1.8</project.java.target>

    <argLine>-Dfile.encoding=${project.build.sourceEncoding}</argLine>
  </properties>

  <dependencies>
    <!-- Core dependencies -->
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
      <version>2.9.6</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>2.9.6</version>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.6</version>
    </dependency>

    <!-- Logging -->
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
      <version>2.11.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-slf4j-impl</artifactId>
      <version>2.11.0</version>
    </dependency>

    <!-- Test dependencies -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>5.2.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>5.2.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.platform</groupId>
      <artifactId>junit-platform-launcher</artifactId>
      <version>1.2.0</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <distributionManagement>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus snapshot repository</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>sonatype-nexus-staging</id>
      <name>Sonatype Nexus release repository</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <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>
    <profile>
      <id>generate-javadoc-html5</id>
      <activation>
        <jdk>[9,)</jdk>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <configuration>
              <additionalJOptions>
                <additionalJOption>-Xdoclint:all</additionalJOption>
                <additionalJOption>-html5</additionalJOption>
              </additionalJOptions>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.0.1</version>
          <configuration>
            <additionalJOptions>
              <additionalJOption>-Xdoclint:all</additionalJOption>
            </additionalJOptions>
            <failOnError>true</failOnError>
          </configuration>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.22.0</version>
        <configuration>
          <forkCount>3</forkCount>
          <reuseForks>true</reuseForks>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>2.22.0</version>
        <configuration>
          <systemPropertyVariables>
            <testsDayLimit>7</testsDayLimit>
          </systemPropertyVariables>
        </configuration>
        <executions>
          <execution>
            <id>integration-test</id>
            <goals>
              <goal>integration-test</goal>
            </goals>
          </execution>
          <execution>
            <id>verify</id>
            <goals>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.8.1</version>
        <executions>
          <!-- Prepares the property pointing to the JaCoCo runtime agent 
            which is passed as a VM argument when maven-surefire-plugin is executed -->
          <execution>
            <id>pre-unit-test</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
            <configuration>
              <!-- Sets the path to the file which contains the execution 
                data -->
              <destFile>${project.build.directory}/jacoco-unit.exec</destFile>
              <!-- Sets the name of the property containing the settings 
                for JaCoCo runtime agent -->
              <propertyName>argLine</propertyName>
            </configuration>
          </execution>
          <!-- Ensures that the code coverage report for unit tests is created 
            after unit tests have been run -->
          <execution>
            <id>post-unit-test</id>
            <phase>test</phase>
            <goals>
              <goal>report</goal>
            </goals>
            <configuration>
              <!-- Sets the path to the file which contains the execution 
                data -->
              <dataFile>${project.build.directory}/jacoco-unit.exec</dataFile>
              <!-- Sets the output directory for the code coverage report -->
              <outputDirectory>${project.reporting.outputDirectory}/jacoco-unit</outputDirectory>
            </configuration>
          </execution>
          <!-- The Executions required by unit tests are omitted. Prepares 
            the property pointing to the JaCoCo runtime agent which is passed as a VM 
            argument when maven-failsafe-plugin is executed. -->
          <execution>
            <id>pre-integration-test</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
            <configuration>
              <!-- Sets the path to the file which contains the execution 
                data -->
              <destFile>${project.build.directory}/jacoco-integration.exec</destFile>
              <!-- Sets the name of the property containing the settings 
                for JaCoCo runtime agent -->
              <propertyName>argLine</propertyName>
            </configuration>
          </execution>
          <!-- Ensures that the code coverage report for integration tests 
            after integration tests have been run -->
          <execution>
            <id>post-integration-test</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>report</goal>
            </goals>
            <configuration>
              <!-- Sets the path to the file which contains the execution 
                data -->
              <dataFile>${project.build.directory}/jacoco-integration.exec</dataFile>
              <!-- Sets the output directory for the code coverage report -->
              <outputDirectory>${project.reporting.outputDirectory}/jacoco-integration</outputDirectory>
            </configuration>
          </execution>
          <execution>
            <id>merge</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>merge</goal>
            </goals>
            <configuration>
              <fileSets>
                <fileSet>
                  <directory>${project.build.directory}</directory>
                  <includes>
                    <include>*.exec</include>
                  </includes>
                </fileSet>
              </fileSets>
              <destFile>${project.build.directory}/jacoco.exec</destFile>
            </configuration>
          </execution>
          <execution>
            <id>report</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>animal-sniffer-maven-plugin</artifactId>
        <version>1.17</version>
        <executions>
          <execution>
            <id>signature-check</id>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <signature>
            <groupId>org.codehaus.mojo.signature</groupId>
            <artifactId>java18</artifactId>
            <version>1.0</version>
          </signature>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.github.siom79.japicmp</groupId>
        <artifactId>japicmp-maven-plugin</artifactId>
        <version>0.12.0</version>
        <!-- These dependencies are needed to compile on Java 9 and onward, 
          as this plugin (version 0.12.0) doesn't yet declare these on their own. These 
          dependencies can be removed in the future when the plugin supports Java 9 
          out-of-box -->
        <!-- The next release after 0.12 (probably 0.13?) added own dependency 
          on javax.activation (see https://github.com/siom79/japicmp/commit/63a399f88bcb220 
          5444051e3117d3269cefcc12f#diff-600376dffeb79835ede4a0b285078036R176) which 
          means that this dependency can be removed after the next release -->
        <dependencies>
          <dependency>
            <groupId>javax.activation</groupId>
            <artifactId>activation</artifactId>
            <version>1.1.1</version>
          </dependency>
        </dependencies>
        <configuration>
          <parameter>
            <onlyModified>true</onlyModified>
            <onlyBinaryIncompatible>false</onlyBinaryIncompatible>
            <breakBuildBasedOnSemanticVersioning>true</breakBuildBasedOnSemanticVersioning>
          </parameter>
        </configuration>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>cmp</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>3.0.0</version>
        <dependencies>
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>8.11</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>checkstyle</id>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <configLocation>src/test/resources/checkstyle/checkstyle.xml</configLocation>
              <suppressionsLocation>src/test/resources/checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
              <failOnViolation>true</failOnViolation>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.7.0</version>
        <configuration>
          <source>${project.java.source}</source>
          <target>${project.java.target}</target>
          <encoding>${project.build.sourceEncoding}</encoding>
          <compilerArgs>
            <arg>-Xlint:all</arg>
          </compilerArgs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <version>3.1.0</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>2.8.2</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.0.0-M2</version>
        <executions>
          <execution>
            <id>enforce-consistency</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <dependencyConvergence />
              </rules>
              <fail>true</fail>
            </configuration>
          </execution>
          <execution>
            <id>enforce-banned-dependencies</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <bannedDependencies>
                  <searchTransitive>true</searchTransitive>
                  <excludes>
                    <!-- CVE-2015-7501 (https://access.redhat.com/security/cve/cve-2015-7501) -->
                    <exclude>commons-collections:commons-collection</exclude>
                  </excludes>
                </bannedDependencies>
              </rules>
              <fail>true</fail>
            </configuration>
          </execution>
          <execution>
            <id>enforce-versions</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>3.1.1</version>
                </requireMavenVersion>
                <requireJavaVersion>
                  <version>${project.java.source}</version>
                </requireJavaVersion>
                <requireSameVersions>
                  <dependencies>
                    <dependency>com.fasterxml.jackson.core:jackson-core</dependency>
                    <dependency>com.fasterxml.jackson.core:jackson-databind</dependency>
                  </dependencies>
                </requireSameVersions>
                <requireSameVersions>
                  <dependencies>
                    <dependency>org.apache.logging.log4j:*</dependency>
                  </dependencies>
                </requireSameVersions>
                <requireSameVersions>
                  <dependencies>
                    <dependency>org.junit.jupiter:*</dependency>
                  </dependencies>
                </requireSameVersions>
                <requireSameVersions>
                  <dependencies>
                    <dependency>org.junit.platform:*</dependency>
                  </dependencies>
                </requireSameVersions>
              </rules>
              <fail>true</fail>
            </configuration>
          </execution>
          <execution>
            <id>enforce-no-snapshots</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireReleaseDeps>
                  <message>No snapshots allowed as release dependencies.</message>
                </requireReleaseDeps>
              </rules>
              <fail>true</fail>
            </configuration>
          </execution>
          <execution>
            <id>enforce-bytecode-version</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <enforceBytecodeVersion>
                  <maxJdkVersion>${project.java.target}</maxJdkVersion>
                  <!-- Exclude SLF4J (1.8.0-alpha2 and later) as it contains 
                    module-info.java, therefore targeted to Java 9. This does however not break 
                    our build, so lets exclude it -->
                  <excludes>
                    <exclude>org.slf4j:slf4j-api:jar:1.8.0-alpha2</exclude>
                  </excludes>
                </enforceBytecodeVersion>
              </rules>
              <fail>true</fail>
            </configuration>
          </execution>
          <execution>
            <id>enforce-ban-duplicate-classes</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <banDuplicateClasses>
                  <findAllDuplicates>true</findAllDuplicates>
                </banDuplicateClasses>
              </rules>
              <fail>true</fail>
            </configuration>
          </execution>
          <!-- Not usable right now, see https://github.com/mojohaus/extra-enforcer-rules/issues/48 -->
          <!-- <execution> -->
          <!-- <id>enforce-utf8-encoding</id> -->
          <!-- <goals> -->
          <!-- <goal>enforce</goal> -->
          <!-- </goals> -->
          <!-- <configuration> -->
          <!-- <rules> -->
          <!-- <requireEncoding> -->
          <!-- <encoding>${project.build.sourceEncoding}</encoding> -->
          <!-- <includes>src/main/resources/**,src/test/resources/**</includes> -->
          <!-- </requireEncoding> -->
          <!-- </rules> -->
          <!-- <failFast>false</failFast> -->
          <!-- <fail>true</fail> -->
          <!-- </configuration> -->
          <!-- </execution> -->
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>extra-enforcer-rules</artifactId>
            <version>1.0-beta-9</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-install-plugin</artifactId>
        <version>2.5.2</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.1.0</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5.3</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.1.0</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.7.1</version>
      </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-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>3.0.0</version>
        <reportSets>
          <reportSet>
            <reports>
              <!-- The ordering of the elements below effects the menu generated 
                by maven-site-plugin, with the top-most element appearing highest in the 
                menu, the next below that and so forth -->
              <report>index</report>
              <report>summary</report>
              <report>ci-management</report>
              <report>dependencies</report>
              <report>dependency-info</report>
              <report>distribution-management</report>
              <report>issue-management</report>
              <report>licenses</report>
              <report>plugin-management</report>
              <report>plugins</report>
              <report>scm</report>
              <report>team</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>

</project>