<?xml version="1.0" encoding="UTF-8"?>
<!--
~ PowerAuth Server and related software components
~ Copyright (C) 2018 Wultra s.r.o.
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU Affero General Public License as published
~ by the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
~ GNU Affero General Public License for more details.
~
~ You should have received a copy of the GNU Affero General Public License
~ along with this program.  If not, see <http://www.gnu.org/licenses/>.
-->

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

    <name>powerauth-server-parent</name>
    <description>PowerAuth Server</description>

    <groupId>io.getlime.security</groupId>
    <artifactId>powerauth-server-parent</artifactId>
    <version>1.7.2</version>
    <packaging>pom</packaging>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.2.4</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <inceptionYear>2017</inceptionYear>
    <url>https://powerauth.com/</url>

    <organization>
        <name>Wultra s.r.o.</name>
        <url>https://wultra.com/</url>
    </organization>

    <licenses>
        <license>
            <name>GNU Affero General Public License v3.0</name>
            <url>https://www.gnu.org/licenses/agpl-3.0.en.html</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Petr Dvorak</name>
            <email>petr@wultra.com</email>
            <roles>
                <role>developer</role>
            </roles>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:https://github.com/wultra/powerauth-server.git</connection>
        <developerConnection>scm:git:https://github.com/wultra/powerauth-server.git</developerConnection>
        <url>https://github.com/wultra/powerauth-server</url>
    </scm>

    <issueManagement>
        <system>Github</system>
        <url>https://github.com/wultra/powerauth-server/issues</url>
    </issueManagement>

    <modules>
        <module>powerauth-client-model</module>
        <module>powerauth-rest-client-spring</module>
        <module>powerauth-fido2</module>
        <module>powerauth-java-server</module>
        <module>powerauth-admin</module>
    </modules>

    <properties>
        <!-- Spring Dependencies -->
        <spring-cloud-vault.version>4.1.1</spring-cloud-vault.version>

        <!-- Wultra Dependencies -->
        <powerauth-java-crypto.version>1.7.0</powerauth-java-crypto.version>
        <wultra-core.version>1.9.0</wultra-core.version>

        <bcprov-jdk18on.version>1.77</bcprov-jdk18on.version>

        <istack-commons-runtime.version>3.0.12</istack-commons-runtime.version>

        <!-- Documentation Dependencies -->
        <springdoc-openapi-starter-webmvc-ui.version>2.5.0</springdoc-openapi-starter-webmvc-ui.version>
        <swagger-annotations-jakarta.version>2.2.21</swagger-annotations-jakarta.version>

        <!-- Scheduled Job Dependencies -->
        <shedlock.version>5.13.0</shedlock.version>

        <!-- Other Dependencies -->
        <commons-text.version>1.11.0</commons-text.version>
        <logstash.version>7.4</logstash.version>
        <equalsverifier.version>3.16.1</equalsverifier.version>
        <zxing.version>3.5.3</zxing.version>

        <!-- Test dependencies -->
        <webauthn4j.version>0.23.0.RELEASE</webauthn4j.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- PowerAuth dependencies -->
            <dependency>
                <groupId>io.getlime.security</groupId>
                <artifactId>powerauth-client-model</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>io.getlime.security</groupId>
                <artifactId>powerauth-rest-client-spring</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>io.getlime.security</groupId>
                <artifactId>powerauth-java-crypto</artifactId>
                <version>${powerauth-java-crypto.version}</version>
            </dependency>

            <!--  Wultra Dependencies  -->
            <dependency>
                <groupId>io.getlime.core</groupId>
                <artifactId>core-bom</artifactId>
                <version>${wultra-core.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcprov-jdk18on</artifactId>
                <version>${bcprov-jdk18on.version}</version>
            </dependency>

            <!-- QR code support -->
            <dependency>
                <groupId>com.google.zxing</groupId>
                <artifactId>zxing-parent</artifactId>
                <version>${zxing.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>io.swagger.core.v3</groupId>
                <artifactId>swagger-annotations-jakarta</artifactId>
                <version>${swagger-annotations-jakarta.version}</version>
            </dependency>

            <!-- Logging -->
            <dependency>
                <groupId>net.logstash.logback</groupId>
                <artifactId>logstash-logback-encoder</artifactId>
                <version>${logstash.version}</version>
            </dependency>

            <!-- Job Scheduling -->
            <dependency>
                <groupId>net.javacrumbs.shedlock</groupId>
                <artifactId>shedlock-bom</artifactId>
                <version>${shedlock.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- API -->
            <dependency>
                <groupId>jakarta.servlet</groupId>
                <artifactId>jakarta.servlet-api</artifactId>
                <scope>provided</scope>
            </dependency>

            <!-- Standalone run -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-tomcat</artifactId>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>org.apache.tomcat.embed</groupId>
                <artifactId>tomcat-embed-el</artifactId>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>nl.jqno.equalsverifier</groupId>
                <artifactId>equalsverifier</artifactId>
                <version>${equalsverifier.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <configuration>
                    <failOnError>false</failOnError>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <additionalOptions>
                                <additionalOption>-Xdoclint:none</additionalOption>
                            </additionalOptions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven-enforcer-plugin.version}</version>
                <executions>
                    <execution>
                        <id>enforce-banned-dependencies</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <bannedDependencies>
                                    <excludes>
                                        <exclude>org.apache.tomcat.embed:*:*:*:compile</exclude>
                                        <exclude>org.bouncycastle:bcpkix-jdk15on:*:*:compile</exclude>
                                        <exclude>org.bouncycastle:bcprov-jdk15on:*:*:compile</exclude>
                                        <!-- Force switching to Jakarta EE -->
                                        <exclude>javax.*</exclude>
                                        <!-- already on application server or servlet container -->
                                        <exclude>jakarta.servlet:jakarta.servlet-api:*</exclude>
                                        <exclude>jakarta.servlet.jsp:jakarta.servlet.jsp-api:*</exclude>
                                        <!-- replaced by jakarta -->
                                        <exclude>com.sun.mail</exclude>
                                        <exclude>com.sun.xml.bind</exclude>
                                    </excludes>
                                    <includes>
                                        <!-- Jakarta API are allowed to be provided -->
                                        <include>jakarta.*:*:jar:*:provided</include>
                                        <!-- Not yet migrated to Jakarta -->
                                        <include>javax.cache:*</include>
                                    </includes>
                                </bannedDependencies>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.kohsuke</groupId>
                        <artifactId>pgp-maven-plugin</artifactId>
                        <version>1.1</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
        <id>internal-repository</id>
        <activation>
            <property>
                <name>useInternalRepo</name>
                <value>true</value>
            </property>
        </activation>
        <properties>
        </properties>
            <distributionManagement>
                <repository>
                    <id>jfrog-central</id>
                    <name>Wultra Artifactory-releases</name>
                    <url>https://wultra.jfrog.io/artifactory/internal-maven-repository</url>
                </repository>
                <snapshotRepository>
                    <id>jfrog-central</id>
                    <name>Wultra Artifactory-snapshots</name>
                    <url>https://wultra.jfrog.io/artifactory/internal-maven-repository</url>
                </snapshotRepository>
            </distributionManagement>
            <repositories>
                <repository>
                    <id>jfrog-central</id>
                    <name>Wultra Artifactory-releases</name>
                    <url>https://wultra.jfrog.io/artifactory/internal-maven-repository</url>
                </repository>
                <repository>
                    <id>ossrh-snapshots</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>
        </profile>
        <profile>
            <id>public-repository</id>
            <activation>
                <property>
                    <name>!useInternalRepo</name>
                </property>
            </activation>
            <properties>
            </properties>
            <distributionManagement>
                <snapshotRepository>
                    <id>ossrh-snapshots-distribution</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
                </snapshotRepository>
                <repository>
                    <id>ossrh-staging-distribution</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
        </profile>
    </profiles>

    <repositories>
        <repository>
            <id>ossrh-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

</project>
