<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>no.digipost</groupId>
    <artifactId>digipost-open-super-pom</artifactId>
    <version>12</version>
    <packaging>pom</packaging>

    <name>Digipost Open Source Project</name>
    <description>Common configuration for Digipost open source projects</description>
    <url>https://github.com/digipost</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>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.2.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>3.2.1</version>
                    <configuration>
                        <rules>
                            <requireMavenVersion>
                                <version>3.6.3</version>
                            </requireMavenVersion>
                        </rules>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.5.0</version>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.6.13</version>
                    <extensions>true</extensions>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>2.15.0</version>
                    <configuration>
                        <generateBackupPoms>false</generateBackupPoms>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.2.1</version>
                    <configuration>
                        <includePom>true</includePom>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.5.0</version>
                    <configuration>
                        <doclint>all,-missing</doclint>
                        <quiet>true</quiet>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>1.6</version>
                </plugin>
                <plugin>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>dependency-analyze</id>
            <properties>
                <failOnWarning>true</failOnWarning>
                <ignoreNonCompile>true</ignoreNonCompile>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>check-declared-vs-used-dependencies</id>
                                <goals>
                                    <goal>analyze-only</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <configuration>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <serverId>sonatype-oss-nexus-staging</serverId>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>build-sources-and-javadoc</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>sign-artifacts</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>japicmp</id>
            <properties>
                <project.previousVersion>set_with_-Dproject.previousVersion=X.Y</project.previousVersion>
            </properties>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>com.github.siom79.japicmp</groupId>
                            <artifactId>japicmp-maven-plugin</artifactId>
                            <version>0.17.2</version>
                            <configuration>
                                <oldVersion>
                                    <dependency>
                                        <groupId>${project.groupId}</groupId>
                                        <artifactId>${project.artifactId}</artifactId>
                                        <version>${project.previousVersion}</version>
                                    </dependency>
                                </oldVersion>
                                <parameter>
                                    <onlyModified>true</onlyModified>
                                    <onlyBinaryIncompatible>true</onlyBinaryIncompatible>
                                    <ignoreMissingOptionalDependency>true</ignoreMissingOptionalDependency>
                                </parameter>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
        <profile>
            <id>check-license-header</id>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>com.mycila</groupId>
                            <artifactId>license-maven-plugin</artifactId>
                            <version>4.2.rc3</version>
                            <configuration>
                                <strictCheck>true</strictCheck>
                                <failIfMissing>true</failIfMissing>
                                <failIfUnknown>true</failIfUnknown>
                                <mapping>
                                    <xjb>XML_STYLE</xjb>
                                </mapping>
                                <licenseSets>
                                    <licenseSet>
                                        <header>src/license-header.txt</header>
                                        <excludes combine.children="append">
                                            <exclude>NOTICE</exclude>
                                            <exclude>LICENSE</exclude>
                                            <exclude>src/NOTICE.template</exclude>
                                            <exclude>.mvn/maven.config</exclude>
                                            <exclude>.java-version</exclude>
                                            <exclude>.github/**/*.yml</exclude>
                                        </excludes>
                                    </licenseSet>
                                </licenseSets>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>com.mycila</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>check-license-header</id>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>include-NOTICE</id>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.jasig.maven</groupId>
                            <artifactId>notice-maven-plugin</artifactId>
                            <version>2.0.0</version>
                            <configuration>
                                <excludeOptional>true</excludeOptional>
                                <excludeScopes>
                                    <excludeScope>test</excludeScope>
                                </excludeScopes>
                                <noticeTemplate>src/NOTICE.template</noticeTemplate>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>org.jasig.maven</groupId>
                        <artifactId>notice-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>check-NOTICE-file</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <scm>
        <connection>scm:git:git@github.com:digipost/digipost-open-super-pom.git</connection>
        <developerConnection>scm:git:git@github.com:digipost/digipost-open-super-pom.git</developerConnection>
        <url>scm:git:git@github.com:digipost/digipost-open-super-pom</url>
        <tag>HEAD</tag>
    </scm>

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

    <organization>
        <name>Digipost</name>
        <url>https://www.digipost.no</url>
    </organization>

    <developers>
        <developer>
            <name>Rune Flobakk</name>
            <url>https://github.com/digipost</url>
            <organization>Digipost</organization>
            <organizationUrl>https://digipost.no</organizationUrl>
        </developer>
    </developers>

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

</project>
