<?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.energiequant.limamf</groupId>
    <artifactId>mf-compat</artifactId>

    <name>LiMa-MF MobiFlight Compatibility</name>
    <description>unofficial library to work with MobiFlight devices and configurations in Java</description>
    <version>0.1</version>
    <packaging>jar</packaging>

    <url>https://github.com/dneuge/lima-mf-compat</url>

    <licenses>
        <license>
            <name>MIT</name>
            <url>https://opensource.org/license/MIT</url>
        </license>
    </licenses>

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

        <!-- runtime dependencies -->
        <slf4j.version>[1.7.36,1.7.99]</slf4j.version>

        <!-- test dependencies -->
        <junit.version>5.9.3</junit.version>
        <assertj.version>3.24.2</assertj.version>
        <hamcrest.version>2.2</hamcrest.version>
        <mockito.version>5.3.1</mockito.version>

        <!-- build dependencies -->
        <maven.plugin.compiler.version>3.14.0</maven.plugin.compiler.version>
        <maven.plugin.dependency.version>3.6.1</maven.plugin.dependency.version>
        <maven.plugin.gpg.version>3.2.7</maven.plugin.gpg.version>
        <maven.plugin.jar.version>3.2.0</maven.plugin.jar.version>
        <maven.plugin.javadoc.version>3.2.0</maven.plugin.javadoc.version>
        <maven.plugin.source.version>3.2.0</maven.plugin.source.version>
        <maven.plugin.surefire.version>3.0.0-M5</maven.plugin.surefire.version>
        <sonatype.plugin.centralPublishing.version>0.7.0</sonatype.plugin.centralPublishing.version>
    </properties>

    <scm>
        <connection>scm:git:git://github.com/dneuge/lima-mf-compat.git</connection>
        <developerConnection>scm:git:ssh://github.com:dneuge/lima-mf-compat.git</developerConnection>
        <url>https://github.com/dneuge/lima-mf-compat</url>
    </scm>

    <developers>
        <developer>
            <name>Daniel Neugebauer</name>
            <email>dneuge@energiequant.de</email>
            <url>http://www.energiequant.de/</url>
        </developer>
    </developers>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${junit.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- runtime dependencies -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>

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

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${assertj.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest</artifactId>
            <version>${hamcrest.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>${maven.plugin.dependency.version}</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven.plugin.source.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <excludes>
                        <exclude>**/ManualTest*</exclude>
                    </excludes>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven.plugin.javadoc.version}</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <sourceFileExcludes>
                        <sourceFileExcludes>**/ManualTest*</sourceFileExcludes>
                    </sourceFileExcludes>
                    <!-- detectOfflineLinks needs to be disabled or artifacts will link to invalid URLs derived from project.url -->
                    <detectOfflineLinks>false</detectOfflineLinks>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.plugin.surefire.version}</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven.plugin.jar.version}</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Built-By></Built-By>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>${maven.plugin.compiler.version}</version>
                        <configuration>
                            <excludes>
                                <exclude>**/ManualTest*</exclude>
                            </excludes>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven.plugin.gpg.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <keyname>${gpg.keyname}</keyname>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>${sonatype.plugin.centralPublishing.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
