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

    <groupId>de.fraunhofer.iosb.ilt</groupId>
    <artifactId>Settings</artifactId>
    <version>1.0</version>
    <packaging>jar</packaging>

    <name>Settings</name>
    <description>A library for loading settings from environment variables.</description>
    <url>https://github.com/FraunhoferIOSB/Settings</url>
    <inceptionYear>2023</inceptionYear>

    <organization>
        <name>Fraunhofer IOSB</name>
        <url>http://iosb.fraunhofer.de</url>
    </organization>

    <licenses>
        <license>
            <name>MIT</name>
            <comments>For more information see the LICENSE file included with the sources.</comments>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Hylke van der Schaaf</name>
            <email>hylke.vanderschaaf@iosb.fraunhofer.de</email>
            <organization>Fraunhofer IOSB</organization>
            <organizationUrl>https://www.iosb.fraunhofer.de</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:hylkevds/Settings.git</connection>
        <developerConnection>scm:git:git@github.com:hylkevds/Settings.git</developerConnection>
        <tag>v1.0</tag>
        <url>https://github.com/FraunhoferIOSB/Settings</url>
    </scm>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/FraunhoferIOSB/Settings/issues</url>
    </issueManagement>

    <distributionManagement>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <properties>
        <maven.compiler.release>17</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <root.basedir>${project.basedir}</root.basedir>

        <version.commons-lang3>3.17.0</version.commons-lang3>
        <version.junit>5.12.2</version.junit>

        <version.maven.plugin.compiler>3.14.0</version.maven.plugin.compiler>
        <version.maven.plugin.gpg>3.2.7</version.maven.plugin.gpg>
        <version.maven.plugin.javadoc>3.11.2</version.maven.plugin.javadoc>
        <version.maven.plugin.nexus-staging>1.7.0</version.maven.plugin.nexus-staging>
        <version.maven.plugin.source>3.3.1</version.maven.plugin.source>
        <version.maven.plugin.spotless>2.44.4</version.maven.plugin.spotless>

        <version.slf4j>2.0.17</version.slf4j>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${version.commons-lang3}</version>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${version.junit}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${version.slf4j}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${version.maven.plugin.compiler}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>${version.maven.plugin.spotless}</version>
                <configuration>
                    <formats>
                        <format>
                            <includes>
                                <include>scripts/codestyle/*.xml</include>
                            </includes>
                            <eclipseWtp>
                                <type>XML</type>
                                <files>
                                    <file>${root.basedir}/scripts/codestyle/xml.prefs</file>
                                </files>
                            </eclipseWtp>
                        </format>
                        <format>
                            <includes>
                                <include>.gitignore</include>
                            </includes>
                            <trimTrailingWhitespace/>
                            <endWithNewline/>
                        </format>
                    </formats>
                    <pom>
                        <includes>
                            <include>**/pom.xml</include>
                        </includes>
                        <sortPom>
                            <keepBlankLines>true</keepBlankLines>
                            <nrOfIndentSpace>4</nrOfIndentSpace>
                            <sortDependencies>groupId,artifactId</sortDependencies>
                            <sortProperties>true</sortProperties>
                            <predefinedSortOrder>recommended_2008_06</predefinedSortOrder>
                            <expandEmptyElements>false</expandEmptyElements>
                        </sortPom>
                    </pom>
                    <java>
                        <eclipse>
                            <version>4.21</version>
                            <file>${root.basedir}/scripts/codestyle/formatter.xml</file>
                        </eclipse>
                        <importOrder/>
                        <removeUnusedImports/>
                        <licenseHeader>
                            <file>${root.basedir}/scripts/license-header</file>
                        </licenseHeader>
                    </java>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <phase>compile</phase>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${version.maven.plugin.source}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                                <phase>verify</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${version.maven.plugin.javadoc}</version>
                        <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>${version.maven.plugin.gpg}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <phase>verify</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${version.maven.plugin.nexus-staging}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
                            <stagingProgressTimeoutMinutes>10</stagingProgressTimeoutMinutes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
