<?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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <packaging>pom</packaging>

    <groupId>com.github.hypfvieh</groupId>
    <artifactId>bluez-dbus-parent</artifactId>
    <version>0.3.2</version>

    <name>${project.artifactId}</name>
    <url>https://github.com/hypfvieh/bluez-dbus</url>

    <description>Java native bluetooth library which uses bluez via dbus (linux only)</description>

    <properties>
        <maven.compiler.release>17</maven.compiler.release>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        
        <junit.version>5.10.3</junit.version>
        <junit.platform.version>1.10.3</junit.platform.version>
        <slf4j.version>2.0.13</slf4j.version>
        <dbus.java.version>5.1.1</dbus.java.version>
        <eclipse.jdt.annotation.version>2.3.0</eclipse.jdt.annotation.version>

        <mvn.gpg.plugin.version>3.2.4</mvn.gpg.plugin.version>
        <mvn.deploy.plugin.version>3.1.2</mvn.deploy.plugin.version>
        <mvn.versions.plugin.version>2.17.1</mvn.versions.plugin.version>
        <mvn.enforcer.plugin.version>3.5.0</mvn.enforcer.plugin.version>
        <mvn.jar.plugin.version>3.4.2</mvn.jar.plugin.version>

        <mvn.surefire.plugin.version>3.3.1</mvn.surefire.plugin.version>
        <mvn.release.plugin.version>3.1.1</mvn.release.plugin.version>
        <mvn.source.plugin.version>3.3.1</mvn.source.plugin.version>
        <mvn.javadoc.plugin.version>3.8.0</mvn.javadoc.plugin.version>

        <mvn.site.plugin.version>3.12.1</mvn.site.plugin.version>
        <mvn.install.plugin.version>3.1.2</mvn.install.plugin.version>
        <mvn.resources.plugin.version>3.3.1</mvn.resources.plugin.version>
        <mvn.clean.plugin.version>3.4.0</mvn.clean.plugin.version>
        <mvn.compiler.plugin.version>3.13.0</mvn.compiler.plugin.version>

        <mvn.bundle.plugin.version>5.1.9</mvn.bundle.plugin.version>
    </properties>

    <modules>
        <module>bluez-dbus</module>
        <module>bluez-dbus-osgi</module>
    </modules>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>

        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${mvn.deploy.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>${mvn.versions.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${mvn.enforcer.plugin.version}</version>
                    <executions>
                        <execution>
                            <id>enforce-maven</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <requireMavenVersion>
                                        <version>3.8.6</version>
                                    </requireMavenVersion>
                                    <requireJavaVersion>
                                        <version>${maven.compiler.source}</version>
                                    </requireJavaVersion>
                                    <requireOS>
                                        <family>unix</family>
                                    </requireOS>
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${mvn.jar.plugin.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>test-jar</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <archive>
                            <manifest>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            </manifest>
                        </archive>
                    </configuration>
                </plugin>
                
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${mvn.surefire.plugin.version}</version>
                    <configuration>
                        <forkCount>1</forkCount>
                        <reuseForks>false</reuseForks>
                        <systemPropertyVariables>
                            <logback.configurationFile>${basedir}/src/test/resources/logback.xml</logback.configurationFile>
                        </systemPropertyVariables>
                    </configuration>
                </plugin>
                
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${mvn.release.plugin.version}</version>
                    <configuration>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <useReleaseProfile>false</useReleaseProfile>
                        <releaseProfiles>release</releaseProfiles>
                        <pushChanges>false</pushChanges>
                        <goals>deploy</goals>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${mvn.source.plugin.version}</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>
                    <version>${mvn.javadoc.plugin.version}</version>
                    <configuration>
                        <doclint>none</doclint>
                    </configuration>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                    
                <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-compiler-plugin</artifactId>
                     <version>${mvn.compiler.plugin.version}</version>
                     <configuration>
                        <release>${maven.compiler.release}</release>
                        <source>${maven.compiler.source}</source>
                        <target>${maven.compiler.target}</target>
                     </configuration>
                </plugin>
                <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-site-plugin</artifactId>
                     <version>${mvn.site.plugin.version}</version>
                </plugin>
                <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-clean-plugin</artifactId>
                     <version>${mvn.clean.plugin.version}</version>
                </plugin>
                <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-resources-plugin</artifactId>
                     <version>${mvn.resources.plugin.version}</version>
                </plugin>
                <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-install-plugin</artifactId>
                     <version>${mvn.install.plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>

    </build>

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

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
         
            <!-- JUnit testing framework. -->
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${junit.version}</version>
            </dependency>

            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-params</artifactId>
                <version>${junit.version}</version>
            </dependency>

            <!-- needed for IDE support -->
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${junit.version}</version>
            </dependency>

            <dependency>
                <groupId>org.junit.platform</groupId>
                <artifactId>junit-platform-launcher</artifactId>
                <version>${junit.platform.version}</version>
            </dependency>
                        
            <dependency>
                <groupId>com.github.hypfvieh</groupId>
                <artifactId>dbus-java-core</artifactId>
                <version>${dbus.java.version}</version>
            </dependency>

	        <dependency>
	            <groupId>com.github.hypfvieh</groupId>
	            <artifactId>dbus-java-transport-junixsocket</artifactId>
                <version>${dbus.java.version}</version>
	        </dependency>

	        <dependency>
	            <groupId>com.github.hypfvieh</groupId>
	            <artifactId>dbus-java-transport-tcp</artifactId>
                <version>${dbus.java.version}</version>
	        </dependency>
            
        </dependencies>        
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>

        <!-- JUnit testing framework. -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>test</scope>
        </dependency>

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

        <!-- needed for IDE support -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-launcher</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <scm>
        <connection>scm:git:https://github.com/hypfvieh/bluez-dbus.git</connection>
        <developerConnection>scm:git:https://github.com/hypfvieh/bluez-dbus.git</developerConnection>
        <url>https://github.com/hypfvieh/bluez-dbus.git</url>
      <tag>bluez-dbus-parent-0.3.2</tag>
  </scm>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://github.com/hypfvieh/bluez-dbus/blob/master/LICENSE</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>hypfvieh</id>
            <name>David M.</name>
            <email>hypfvieh@googlemail.com</email>
        </developer>
    </developers>

    <profiles>
        <profile>
            <id>release</id>
            <properties>
                <gpg.executable>gpg2</gpg.executable>
            </properties>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${mvn.gpg.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>install</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
