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

    The MIT License
     Copyright © 2023 Landeshauptstadt München | it@M

     Permission is hereby granted, free of charge, to any person obtaining a copy
     of this software and associated documentation files (the "Software"), to deal
     in the Software without restriction, including without limitation the rights
     to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
     copies of the Software, and to permit persons to whom the Software is
     furnished to do so, subject to the following conditions:

     The above copyright notice and this permission notice shall be included in
     all copies or substantial portions of the Software.

     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
     AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
     THE SOFTWARE.

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

    <groupId>de.muenchen.oss.mobidam</groupId>
    <artifactId>mobidam-eai-commons</artifactId>
    <version>0.0.2</version>

    <packaging>pom</packaging>
    <name>mobidam-eai-commons</name>
    <description>Spring Boot starter for integration into Apache Camel EAI components. The starter implements access to s3 credentials, which are provided in environment variables.</description>
    <url>https://github.com/it-at-m/mobidam-eai-commons-starter/</url>

    <licenses>
        <license>
            <name>MIT License</name>
        </license>
    </licenses>

    <organization>
        <name>Landeshauptstadt München - it@M</name>
        <url>https://muenchen.digital/it-at-m/</url>
    </organization>

    <developers>
        <developer>
            <name>sfi2022</name>
            <organization>Landeshauptstadt München</organization>
            <url>https://github.com/sfi2022</url>
            <roles><role>mobidam_devs</role></roles>
        </developer>
    </developers>

    <scm>
        <url>${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}</url>
        <connection>scm:git:${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git</connection>
        <developerConnection>scm:git:${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git</developerConnection>
        <tag>0.0.2</tag>
  </scm>


    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <maven-scm-plugin.version>1.10.0</maven-scm-plugin.version>

        <spring.boot.version>3.3.4</spring.boot.version>

        <maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>

        <skipGpg>false</skipGpg>
    </properties>

    <modules>
        <module>mobidam-eai-commons-lib</module>
        <module>mobidam-eai-commons-starter</module>
    </modules>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!-- Central Portal Publishing Plugin -->
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <extensions>true</extensions>
                        <configuration>
                            <tokenAuth>true</tokenAuth>
                            <autoPublish>true</autoPublish>
                            <deploymentName>${project.groupId}:${project.artifactId}:${project.version}</deploymentName>
                        </configuration>
                    </plugin>
                    <!-- GPG plugin -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <configuration>
                            <skip>${skipGpg}</skip>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <!-- Prevent `gpg` from using pinentry programs -->
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.3.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>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.central</groupId>
                    <artifactId>central-publishing-maven-plugin</artifactId>
                    <version>0.4.0</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                    <goals>deploy</goals>
                    <tagNameFormat>@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>3.1.1</version>
            </plugin>
            <!-- Codeformatter Spotless -->
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>2.28.0</version>
                <dependencies>
                    <dependency>
                        <groupId>de.muenchen.oss</groupId>
                        <artifactId>itm-java-codeformat</artifactId>
                        <version>1.0.7</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <java>
                        <includes>
                            <include>**/src/main/java/**/*.java</include> <!-- Check application code -->
                            <include>**/src/test/java/**/*.java</include> <!-- Check application tests code -->
                        </includes>
                        <excludes />
                        <eclipse>
                            <file>itm-java-codeformat/java_codestyle_formatter.xml</file>
                        </eclipse>
                        <trimTrailingWhitespace />
                        <endWithNewline />
                    </java>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!--             Linter Checkstyle -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.2.1</version>
                <configuration>
                    <configLocation>checkstyle.xml</configLocation>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>9.3</version>
                    </dependency>
                </dependencies>
            </plugin>

            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>4.3</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                            <goal>format</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <properties>
                        <owner>Landeshauptstadt München | it@M</owner>
                        <year>2024</year>
                    </properties>
                    <header>com/mycila/maven/plugin/license/templates/MIT.txt</header>
                    <failIfMissing>true</failIfMissing>
                    <useDefaultExcludes>true</useDefaultExcludes>
                    <aggregate>true</aggregate>
                    <excludes>
                        <exclude>**/*.txt</exclude>
                        <exclude>**/*.yml</exclude>
                    </excludes>
                    <includes>
                        <include>mobidam-eai-commons-lib/**/*</include>
                        <include>mobidam-eai-commons-starter/**/*</include>
                    </includes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>${spring.boot.version}</version>
                <configuration>
                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
            </plugin>
        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <!-- Import dependency management from Spring Boot -->
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring.boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

</project>