<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <!-- Attention! We need to keep this in sync with the spring-boot version set in sip-framework,
             which is transitively referenced in sip-integration-starter specified in the dependencymanagement section -->
        <version>3.2.7</version>
    <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <groupId>de.ikor.sip.foundation</groupId>
    <artifactId>sip-starter-parent</artifactId>
    <version>3.4.0</version>
    <packaging>pom</packaging>
    <name>SIP Starter Parent</name>
    <description>Parent pom providing dependency and plugin management for SIP integration adapters built with Maven
    </description>
    <url>https://github.com/IKOR-GmbH/sip-framework</url>

    <scm>
        <connection>scm:git:git://github.com/IKOR-GmbH/sip-framework.git</connection>
        <developerConnection>scm:git:ssh:IKOR-GmbH/sip-framework.git</developerConnection>
        <url>https://github.com/IKOR-GmbH/sip-framework/tree/main</url>
    </scm>

    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>https://raw.githubusercontent.com/IKOR-GmbH/sip-framework/develop/LICENSE.md</url>
        </license>
    </licenses>

    <organization>
        <name>IKOR GmbH</name>
        <url>https://ikor.one</url>
    </organization>

    <developers>
        <developer>
            <name>SIP Development Team</name>
            <email>info-finsure@ikor.one</email>
            <organization>IKOR</organization>
            <organizationUrl>https://ikor.one/</organizationUrl>
        </developer>
    </developers>

    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/IKOR-GmbH/sip-framework/issues</url>
    </issueManagement>

    <properties>
        <java.version>17</java.version>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>

        <sip-framework.version>3.4.0</sip-framework.version>               <!-- keep in sync with framework version -->
        <mapstruct.version>1.5.5.Final</mapstruct.version>                          <!-- keep in sync with mapstruct version in framework pom -->
        <lombok.version>1.18.30</lombok.version>                                    <!-- keep in sync with lombok version in framework pom -->
        <cxf.version>4.0.4</cxf.version>                                            <!-- keep in sync with cxf version in framework pom -->
        <snakeyaml.version>2.2</snakeyaml.version>                                  <!-- keep in sync with snakeyaml version in framework pom -->
        <lombok-mapstruct-binding.version>0.2.0</lombok-mapstruct-binding.version>
        <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>                  <!-- keep in sync with framework, for maven central deployment -->
        <nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>  <!-- keep in sync with framework, for maven central deployment -->
    </properties>

    <dependencies>
        <dependency>
            <groupId>de.ikor.sip.foundation</groupId>
            <artifactId>sip-integration-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.camel.springboot</groupId>
            <artifactId>camel-servlet-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.camel.springboot</groupId>
            <artifactId>camel-openapi-java-starter</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>io.swagger.core.v3</groupId>
                    <artifactId>swagger-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.swagger.parser.v3</groupId>
                    <artifactId>swagger-parser-v3</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.swagger.parser.v3</groupId>
                    <artifactId>swagger-parser</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.camel.springboot</groupId>
            <artifactId>camel-http-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.camel.springboot</groupId>
            <artifactId>camel-bindy-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.camel.springboot</groupId>
            <artifactId>camel-bean-validator-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct</artifactId>
            <version>${mapstruct.version}</version>
        </dependency>
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>${snakeyaml.version}</version>
        </dependency>

        <!-- runtime dependencies -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <!-- test dependencies -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>de.ikor.sip.foundation</groupId>
                <artifactId>sip-framework</artifactId>
                <version>${sip-framework.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>de.ikor.sip.foundation</groupId>
                    <artifactId>sip-maven-plugin</artifactId>
                    <version>${sip-framework.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>connectors-cross-dependencies-check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.cxf</groupId>
                    <artifactId>cxf-codegen-plugin</artifactId>
                    <version>${cxf.version}</version>
                    <executions>
                        <execution>
                            <id>generate-sources</id>
                            <phase>generate-sources</phase>
                            <configuration>
                                <sourceRoot>${project.build.directory}/generated-sources/wsdlimport</sourceRoot>
                                <wsdlRoot>${basedir}/src/main/resources</wsdlRoot>
                                <includes>
                                    <include>**/*.wsdl</include>
                                </includes>
                            </configuration>
                            <goals>
                                <goal>wsdl2java</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>package-deployment</id>
            <distributionManagement>
                <snapshotRepository>
                    <id>maven-central</id>
                    <name>GitHub Packages</name>
                    <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
            </distributionManagement>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${nexus-staging-maven-plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>maven-central</serverId>
                            <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
