<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2017-2022 Rudy De Busscher (https://www.atbash.be)

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

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

-->
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>be.atbash.json</groupId>
        <artifactId>jwt-support-parent</artifactId>
        <version>1.0.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>octopus-jwt-support</artifactId>
    <version>1.0.0</version>
    <packaging>jar</packaging>

    <inceptionYear>2017</inceptionYear>

    <name>Atbash Octopus JWT Support</name>
    <description>Atbash Octopus JWT Support</description>
    <url>https://raw.githubusercontent.com/atbashEE/octopus-jwt-support/master/src/main/doc/manual.adoc</url>

    <developers>
        <developer>
            <id>rubus</id>
            <name>Rudy De Busscher</name>
            <email>rdebusscher@gmail.com</email>
            <organization>Atbash, Belgium</organization>
            <timezone>+1</timezone>
        </developer>
    </developers>

    <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>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git://github.com/atbashEE/octopus-jwt-support.git</connection>
        <developerConnection>scm:git:ssh://github.com:atbashEE/octopus-jwt-support.git</developerConnection>
        <url>http://github.com/atbashEE/octopus-jwt-support/tree/master</url>
    </scm>

    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <asciidoctor.maven.plugin.version>1.5.6</asciidoctor.maven.plugin.version>
        <asciidoctorj.pdf.version>1.5.0-alpha.16</asciidoctorj.pdf.version>

    </properties>

    <dependencies>

        <dependency>
            <groupId>be.atbash.config</groupId>
            <artifactId>atbash-config</artifactId>
            <version>${atbash-config.version}</version>
        </dependency>

        <dependency>
            <groupId>org.eclipse.microprofile.config</groupId>
            <artifactId>microprofile-config-api</artifactId>
            <version>${microprofile-config.version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- atbash -->
        <!-- comes also through transient dependencies, but want to make sure we use the correct version -->
        <dependency>
            <groupId>be.atbash.utils</groupId>
            <artifactId>utils-se</artifactId>
            <version>${atbash-utils.version}</version>
        </dependency>

        <dependency>
            <groupId>be.atbash.utils</groupId>
            <artifactId>utils-cdi</artifactId>
            <version>${atbash-utils.version}</version>
        </dependency>

        <dependency>
            <groupId>javax.json.bind</groupId>
            <artifactId>javax.json.bind-api</artifactId>
            <version>${javax.json.bind.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.json</groupId>
            <artifactId>javax.json-api</artifactId>
            <version>${javax.json.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcpkix-jdk15on</artifactId>
            <version>1.70</version>
        </dependency>

        <!-- test dependencies-->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>5.3.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <version>5.3.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>2.23.0</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <version>2.23.0</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>2.9.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>net.jadler</groupId>
            <artifactId>jadler-all</artifactId>
            <version>1.3.0</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>net.jadler</groupId>
                    <artifactId>jadler-junit</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>uk.org.lidalia</groupId>
            <artifactId>slf4j-test</artifactId>
            <version>1.2.0</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.eclipse</groupId>
            <artifactId>yasson</artifactId>
            <version>1.0.11</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.json</artifactId>
            <version>1.1.4</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <!-- required for AbstractJacksonJsonSerializerTest -->
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>2.13.2</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>be.atbash.config</groupId>
            <artifactId>atbash-config-test</artifactId>
            <version>${atbash-config.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>be.atbash.utils</groupId>
            <artifactId>utils-se</artifactId>
            <version>${atbash-utils.version}</version>
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>animal-sniffer-maven-plugin</artifactId>
                <version>1.16</version>
                <executions>
                    <execution>
                        <phase>test</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <signature>
                                <groupId>org.codehaus.mojo.signature</groupId>
                                <artifactId>java18</artifactId>
                                <version>1.0</version>
                            </signature>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>clirr-maven-plugin</artifactId>
                <version>2.8</version>
                <configuration>
                    <ignored>
                        <!-- Should not be used outside the library -->
                        <difference>
                            <className>**/parameter/JWTParametersEncryption</className>
                            <differenceType>7002</differenceType>
                            <method>java.security.Key getJWK()</method>
                        </difference>
                        <!-- Removal of KeyUse -->
                        <difference>
                            <className>**/keys/AtbashKey</className>
                            <differenceType>7002</differenceType>
                            <method>AtbashKey(java.lang.String, java.util.List, java.security.Key)</method>
                        </difference>
                        <difference>
                            <className>**/keys/AtbashKey</className>
                            <differenceType>7002</differenceType>
                            <method>java.util.List getKeyUses()</method>
                        </difference>
                        <difference>
                            <className>**/generator/GenerationParameters</className>
                            <differenceType>7002</differenceType>
                            <method>java.util.List getKeyUsage()</method>
                        </difference>

                        <!-- documented in Breaking changes -->
                        <difference>
                            <className>**/keys/KeyManager</className>
                            <differenceType>7005</differenceType>
                            <method>*</method>
                            <to>*</to>
                        </difference>
                        <!-- internal class -->
                        <difference>
                            <className>**/keys/LocalKeyManager</className>
                            <differenceType>7005</differenceType>
                            <method>*</method>
                            <to>*</to>
                        </difference>
                    </ignored>

                </configuration>
            </plugin>

            <plugin>
                <groupId>org.asciidoctor</groupId>
                <artifactId>asciidoctor-maven-plugin</artifactId>
                <version>${asciidoctor.maven.plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctorj-pdf</artifactId>
                        <version>${asciidoctorj.pdf.version}</version>
                    </dependency>

                </dependencies>
                <configuration>
                    <sourceDirectory>src/main/doc</sourceDirectory>
                    <!-- Attributes common to all output formats -->
                    <attributes>
                        <sourcedir>${project.build.sourceDirectory}</sourcedir>
                    </attributes>
                    <skip>${documentation.skip}</skip>
                </configuration>
                <executions>
                    <execution>
                        <id>generate-pdf-doc</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>process-asciidoc</goal>
                        </goals>
                        <configuration>
                            <backend>pdf</backend>
                            <!-- Since 1.5.0-alpha.9 PDF back-end can use 'rouge' as well as 'coderay'
                            for source highlighting -->
                            <!-- Due to a known issue on windows, it is recommended to use 'coderay' until an new version of 'rouge' is released.
                                    see discussions: https://github.com/asciidoctor/asciidoctor-maven-examples/pull/58
                                                     https://github.com/asciidoctor/asciidoctorj-pdf/issues/3
                                                     https://github.com/jneen/rouge/issues/661
                            -->
                            <sourceHighlighter>coderay</sourceHighlighter>
                            <attributes>
                                <icons>font</icons>
                                <pagenums/>
                                <toc/>
                                <idprefix/>
                                <idseparator>-</idseparator>
                            </attributes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <header>src/etc/headerTemplate.txt</header>
                    <properties>
                        <owner>Rudy De Busscher</owner>
                        <site>https://www.atbash.be</site>
                        <year>2017</year>
                        <aggregate>true</aggregate>
                    </properties>
                    <excludes>
                        <exclude>**/*.adoc</exclude>
                        <exclude>**/*.adi</exclude>
                        <exclude>**/*.jwk</exclude>
                        <exclude>**/*.pem</exclude>
                        <exclude>**/*.jwke</exclude>
                        <exclude>**/*.jwkset</exclude>
                        <exclude>**/README</exclude>
                        <exclude>**/LICENSE</exclude>
                        <exclude>**/NOTICE.txt</exclude>
                        <exclude>**/NOTICE</exclude>

                    </excludes>
                    <mapping>
                        <java>SLASHSTAR_STYLE</java>
                    </mapping>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>com.mycila</groupId>
                        <artifactId>license-maven-plugin-git</artifactId>
                        <version>3.0</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <!-- For JUnit 5 -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.1</version>
            </plugin>

        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <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>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.4</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Configure the jar with the javadoc (or rather, convince Maven that
                        we want javadoc at all) -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.10.3</version>
                        <configuration>
                            <javadocVersion>1.8</javadocVersion>
                            <notimestamp>true</notimestamp>
                            <!--splitindex>true</splitindex-->
                            <doctitle>${project.name} ${project.version}</doctitle>
                            <additionalparam>-Xdoclint:none</additionalparam>
                            <bottom>
                                <![CDATA[]]>
                            </bottom>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <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>
