<?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" xml:space="preserve">

    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>no.priv.bang.pom</groupId>
        <artifactId>bang-app-pom</artifactId>
        <version>2.1.2</version>
    </parent>
    <groupId>no.priv.bang.authservice</groupId>
    <artifactId>authservice-parent</artifactId>
    <version>2.2.0</version>

    <packaging>pom</packaging>

    <name>Authentication webapp</name>
    <description>A drop-in shiro user database for apache karaf web whiteboard, with user administration UI and user self-service password and user info change. In addition can serve as forms based authentication for nginx</description>

    <modules>
        <module>authservice</module>
        <module>jacoco-coverage-report</module>
        <module>authservice-bom</module>
    </modules>

    <properties>
        <snakeyaml.version>1.17</snakeyaml.version>
        <open-iconic.version>1.1.1</open-iconic.version>
        <sonar.cpd.exclusions>
            **/TestLiquibaseRunner.java,
            **/ProductionLiquibaseRunner.java,
            **/AuthserviceServlet.java,
            **/UserAdminWebApiServlet.java,
            **/UsersResource.java
        </sonar.cpd.exclusions>
        <sonar.issue.ignore.multicriteria>e1</sonar.issue.ignore.multicriteria>
        <sonar.issue.ignore.multicriteria.e1.ruleKey>java:S6813</sonar.issue.ignore.multicriteria.e1.ruleKey>
        <sonar.issue.ignore.multicriteria.e1.resourceKey>**/authservice.web.*/src/main/java/**/resources/*.java</sonar.issue.ignore.multicriteria.e1.resourceKey>
        <sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/../../jacoco-coverage-report/target/site/jacoco-aggregate/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <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>
                <configuration>
                    <show>private</show>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>aggregate-javadocs</id>
                        <goals>
                            <goal>aggregate-no-fork</goal>
                        </goals>
                        <phase>prepare-package</phase>
                        <inherited>false</inherited>
                        <configuration>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-aggregate-javadoc</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <phase>package</phase>
                        <inherited>false</inherited>
                        <configuration>
                            <classesDirectory>${project.build.directory}/site/apidocs</classesDirectory>
                            <classifier>javadoc</classifier>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.eluder.coveralls</groupId>
                <artifactId>coveralls-maven-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>jakarta.xml.bind</groupId>
                        <artifactId>jakarta.xml.bind-api</artifactId>
                        <version>2.3.3</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <jacocoReports>
                        <jacocoReport>${project.basedir}/jacoco-coverage-report/target/site/jacoco-aggregate/jacoco.xml</jacocoReport>
                    </jacocoReports>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <releaseProfiles>release-sign-artifact</releaseProfiles>
                    <tagNameFormat>authservice-@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <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>

    <licenses>
        <license>
            <name>Apache License version 2</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Steinar Bang</name>
            <email>sb@dod.no</email>
            <url>https://steinar.bang.priv.no/</url>
            <organization>steinarb-github</organization>
            <organizationUrl>https://github.com/steinarb</organizationUrl>
        </developer>
    </developers>

    <scm>
        <url>https://github.com/steinarb/authservice</url>
        <connection>scm:git:https://github.com/steinarb/authservice.git</connection>
        <tag>authservice-2.2.0</tag>
    </scm>

    <issueManagement>
        <url>https://github.com/steinarb/authservice/issues</url>
        <system>Github issue tracker</system>
    </issueManagement>

    <ciManagement>
        <url>https://travis-ci.org/steinarb/authservice</url>
        <system>travis-ci</system>
    </ciManagement>

    <url>http://steinarb.github.io/authservice/</url>

    <profiles>
        <profile>
            <id>release-sign-artifact</id>
            <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>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>nexusDeployRelease</id>
            <activation>
                <property>
                    <name>!skipNexusDeployRelease</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
