<?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright 2017-2021 Norwegian Agency for Public Management and eGovernment (Difi)
    Copyright (C) 2022-2023 Norstella Oxalis Network (www.oxalis.network)

    Licensed under the EUPL, Version 1.1 or – as soon they
    will be approved by the European Commission - subsequent
    versions of the EUPL (the "Licence");

    You may not use this work except in compliance with the Licence.

    You may obtain a copy of the Licence at:

    https://joinup.ec.europa.eu/community/eupl/og_page/eupl

    Unless required by applicable law or agreed to in
    writing, software distributed under the Licence is
    distributed on an "AS IS" basis,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
    express or implied.
    See the Licence for the specific language governing
    permissions and limitations under the Licence.

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

    <groupId>network.oxalis.commons</groupId>
    <artifactId>commons-certvalidator</artifactId>
    <packaging>jar</packaging>
    <version>4.0.0</version>

    <name>Oxalis Certificate validator</name>
    <description>Rule engine for creation of certificate validator.</description>
    <url>https://github.com/OxalisCommunity/commons-certvalidator</url>

    <scm>
        <tag>commons-certvalidator-4.0.0</tag>
        <url>https://github.com/OxalisCommunity/commons-certvalidator</url>
        <connection>scm:git:git@github.com:OxalisCommunity/commons-certvalidator.git</connection>
        <developerConnection>scm:git:git@github.com:OxalisCommunity/commons-certvalidator.git</developerConnection>
    </scm>

    <issueManagement>
        <url>https://github.com/OxalisCommunity/commons-certvalidator/issues</url>
        <system>GitHub Issues</system>
    </issueManagement>

    <organization>
        <name>NorStella</name>
        <url>https://en.norstella.no/</url>
    </organization>

    <developers>
        <developer>
            <name>Arun Kumar</name>
            <email>arun.kaundal@gmail.com</email>
            <organization>Norstella</organization>
            <roles>
                <role>Oxalis Technical Expert</role>
            </roles>
        </developer>
        <developer>
            <name>Aslak Os</name>
            <email>aslak@rocketfarm.no</email>
            <organization>Rocketfarm</organization>
            <organizationUrl>http://www.rocketfarm.no/</organizationUrl>
            <roles>
                <role>Developer</role>
            </roles>
        </developer>
        <developer>
            <name>Erlend Klakegg Bergheim</name>
            <email>erlend.klakegg.bergheim@difi.no</email>
            <organization>Difi</organization>
            <roles>
                <role>Principal author</role>
            </roles>
        </developer>
        <developer>
            <id>glenn.bech</id>
            <name>Glenn Bech</name>
            <email>glenn.bech@inmeta.com</email>
            <organization>Inmeta Consulting</organization>
            <organizationUrl>http://www.inmeta.no</organizationUrl>
            <roles>
                <role>Developer</role>
            </roles>
            <properties>
                <picUrl>http://www.gravatar.com/avatar/0335ace39946d72354bd085c499cae12.jpg</picUrl>
            </properties>
        </developer>
        <developer>
            <name>Thomas Reppesgård</name>
            <email>thomas.reppesgard@difi.no</email>
            <organization>Difi</organization>
            <roles>
                <role>Developer</role>
            </roles>
        </developer>
        <developer>
            <name>Thomas Johansen</name>
            <email>thomas@thomasjohansen.it</email>
            <organization>Thomas Johansen Consulting</organization>
            <organizationUrl>https://thomasjohansen.it</organizationUrl>
            <roles>
                <role>Developer</role>
            </roles>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>European Union Public Licence (EUPL v.1.1)</name>
            <url>https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence-eupl-v11</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <properties>
        <java.encoding>UTF-8</java.encoding>
        <java.version>11</java.version>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <bouncycastle.version>1.70</bouncycastle.version>
        <testng.version>7.7.1</testng.version>
        <mockito-core.version>4.11.0</mockito-core.version>
        <joda-time.version>2.12.0</joda-time.version>
        <jakarta.xml.bind-api-version>2.3.3</jakarta.xml.bind-api-version>
        <jaxb-impl-version>2.3.3</jaxb-impl-version>
        <guava.version>31.1-jre</guava.version>
        <pkix-ocsp.version>2.0.0</pkix-ocsp.version>
        <metainf-services.version>1.9</metainf-services.version>
    </properties>

    <dependencies>
        <!-- BouncyCastle -->
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcpkix-jdk15on</artifactId>
            <version>${bouncycastle.version}</version>
        </dependency>

        <!-- Testing -->
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>${testng.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito-core.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- Joda -->
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>${joda-time.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
            <version>${jakarta.xml.bind-api-version}</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>${jaxb-impl-version}</version>
            <scope>runtime</scope>
        </dependency>

        <!-- Guava -->
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guava.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>com.google.code.findbugs</groupId>
                    <artifactId>jsr305</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- OCSP -->
        <dependency>
            <groupId>network.oxalis.pkix</groupId>
            <artifactId>pkix-ocsp</artifactId>
            <version>${pkix-ocsp.version}</version>
        </dependency>

        <!-- META-INF/services -->
        <dependency>
            <groupId>org.kohsuke.metainf-services</groupId>
            <artifactId>metainf-services</artifactId>
            <version>${metainf-services.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.10.1</version>
                <configuration>
                    <encoding>${java.encoding}</encoding>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.3.0</version>
                <configuration>
                    <encoding>${java.encoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.2</version>
            </plugin>

            <plugin>
                <groupId>org.jvnet.jaxb2.maven2</groupId>
                <artifactId>maven-jaxb2-plugin</artifactId>
                <version>0.14.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <encoding>${java.encoding}</encoding>
                            <generateDirectory>target/generated-sources/xjc/</generateDirectory>
                            <schemaDirectory>${basedir}/src/main/xsd</schemaDirectory>
                            <schemaIncludes>
                                <include>*.xsd</include>
                            </schemaIncludes>
                            <bindingDirectory>${basedir}/src/main/xjb</bindingDirectory>
                            <bindingIncludes>
                                <include>*.xjb</include>
                            </bindingIncludes>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>jakarta.xml.bind</groupId>
                        <artifactId>jakarta.xml.bind-api</artifactId>
                        <version>2.3.3</version>
                    </dependency>
                    <dependency>
                        <groupId>com.sun.xml.bind</groupId>
                        <artifactId>jaxb-impl</artifactId>
                        <version>2.3.3</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.8</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <excludes>
                        <exclude>network/oxalis/commons/certvalidator/jaxb/**</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>properties-maven-plugin</artifactId>
                <version>1.1.0</version>
                <executions>
                    <execution>
                        <id>set-additional-system-properties</id>
                        <goals>
                            <goal>set-system-properties</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <properties>
                        <property>
                            <name>javax.xml.accessExternalSchema</name>
                            <value>all</value>
                        </property>
                    </properties>
                    <outputFile>${project.build.outputDirectory}/project.properties</outputFile>
                </configuration>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.4.1</version>
                    <executions>
                        <execution>
                            <id>package-javadoc</id>
                            <phase>package</phase>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <encoding>${java.encoding}</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.3</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.maven.scm</groupId>
                            <artifactId>maven-scm-provider-gitexe</artifactId>
                            <version>1.13.0</version>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.maven.scm</groupId>
                            <artifactId>maven-scm-api</artifactId>
                            <version>1.13.0</version>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </pluginManagement>
    </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-source-plugin</artifactId>
                        <version>3.2.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.4.1</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <encoding>${java.encoding}</encoding>
                            <additionalOptions>
                                <additionalOption>-Xdoclint:none</additionalOption>
                            </additionalOptions>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.0.1</version>
                        <configuration>
                            <!-- Prevent gpg from using pinentry programs -->
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

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