<?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>
    <groupId>de.ibapl.spsw</groupId>
    <artifactId>spsw-project</artifactId>
    <packaging>pom</packaging>
    <version>3.1.0</version>
    <name>SPSW</name>
    <url>https://github.com/aploese/spsw</url>
    <inceptionYear>2009</inceptionYear>

    <description>
        Access the serial port with spsw subpackages.
    </description>

    <organization>
        <name>Arne Plöse</name>
    </organization>

    <properties>
        <project.scm.id>github</project.scm.id>
        <compile.source>11</compile.source>
        <compile.target>11</compile.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <developers>
        <developer>
            <id>apl</id>
            <name>Arne Plöse</name>
            <email>aploese@gmx.de</email>
            <url>http://github.com/aploese</url>
            <roles>
                <role>architect</role>
                <role>developer</role>
            </roles>
            <timezone>+1</timezone>
        </developer>
    </developers>

    <!-- Licenses -->
    <licenses>
        <license>
            <name>GNU LESSER GENERAL PUBLIC LICENSE, Version 3</name>
            <url>http://www.gnu.org/licenses/lgpl.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <issueManagement>
        <url>https://github.com/aploese/spsw/issues</url>
        <system>GitHub Issues</system>
    </issueManagement>

    <!--repositories> <repository> <id>sonatype-nexus-snapshots</id> <name>Sonatype
    Nexus Snapshots</name> <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled>
    </snapshots> </repository> </repositories -->

    <profiles>

        <profile>
            <id>deploy</id>
            <properties>
                <!-- Exclude all HW tests -->
                <excludeJunit5Tags>Baseline,DtrDsr,HighSpeed,LowSpeed,NotSupportedByDevice,RtsCts,SlowTest</excludeJunit5Tags>
                <includeJunit5Tags />
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>generate-javadoc</id>
                            <phase>package</phase>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>generate-source</id>
                            <phase>package</phase>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>BaselineTests</id>
            <properties>
                <excludeJunit5Tags />
                <includeJunit5Tags>Baseline</includeJunit5Tags>
            </properties>
        </profile>

        <profile>
            <id>RtsCtsTests</id>
            <properties>
                <excludeJunit5Tags />
                <includeJunit5Tags>RtsCts</includeJunit5Tags>
            </properties>
        </profile>
    </profiles>


    <distributionManagement>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus Snapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        </snapshotRepository>
        <repository>
            <id>sonatype-nexus-staging</id>
            <name>Nexus Release Repository</name>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <scm>
        <url>https://github.com/aploese/spsw</url>
        <connection>scm:git:https://github.com/aploese/spsw.git</connection>
        <developerConnection>scm:git:git@github.com:aploese/spsw.git</developerConnection>
        <tag>spsw-project-3.1.0</tag>
    </scm>


    <modules>
        <module>de.ibapl.spsw.api</module>
        <module>de.ibapl.spsw.api.tests</module>
        <module>de.ibapl.spsw.jnhwprovider</module>
        <module>de.ibapl.spsw.jniprovider</module>
        <module>it</module>
    </modules>

    <!-- Dependency Management and Dependencies to Inherit -->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.annotation</artifactId>
                <version>[6.0.0,7.0.0)</version>
            </dependency>
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.service.component.annotations</artifactId>
                <version>1.4.0</version>
                <!--TODO using 1.4.0 will bring lots of unresolved issues in integration
                tests .... -->
            </dependency>
            <dependency>
                <groupId>de.ibapl.jnhw</groupId>
                <artifactId>de.ibapl.jnhw.libloader</artifactId>
                <!--version>3.0.0-SNAPSHOT</version-->
                <version>[3.0.0,4.0.0)</version>
            </dependency>
            <dependency>
                <groupId>de.ibapl.jnhw</groupId>
                <artifactId>de.ibapl.jnhw.posix</artifactId>
                <!--version>3.0.0-SNAPSHOT</version-->
                <version>[3.0.0,4.0.0)</version>
            </dependency>
            <dependency>
                <groupId>de.ibapl.jnhw</groupId>
                <artifactId>de.ibapl.jnhw.winapi</artifactId>
                <!--version>3.0.0-SNAPSHOT</version-->
                <version>[3.0.0,4.0.0)</version>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>5.7.2</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>5.7.2</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-params</artifactId>
                <version>5.7.2</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>


    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-enforcer-plugin</artifactId>
                  <version>3.0.0</version>
                  <executions>
                    <execution>
                      <id>enforce-maven</id>
                      <goals>
                        <goal>enforce</goal>
                      </goals>
                      <configuration>
                        <rules>
                          <requireMavenVersion>
                            <version>3.6</version>
                          </requireMavenVersion>
                        </rules>    
                      </configuration>
                    </execution>
                  </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.0.0-M5</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.1</version>
                    <configuration>
                        <source>${compile.source}</source>
                        <target>${compile.target}</target>
                        <encoding>${sourceEncoding}</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>4.1</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.2.0</version>
                    <configuration>
                        <archive>
                            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>3.0.0-M4</version>
                    <configuration>
                        <localCheckout>true</localCheckout>
                        <pushChanges>false</pushChanges>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.0.1</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.3.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.2.1</version>
                </plugin>
                <plugin>
                    <groupId>biz.aQute.bnd</groupId>
                    <artifactId>bnd-maven-plugin</artifactId>
                    <version>5.3.0</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>bnd-process</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration />
                </plugin>
                <plugin>
                    <groupId>biz.aQute.bnd</groupId>
                    <artifactId>bnd-testing-maven-plugin</artifactId>
                    <version>5.3.0</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>testing</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>com.github.spotbugs</groupId>
                    <artifactId>spotbugs-maven-plugin</artifactId>
                    <version>4.3.0</version>
                </plugin>
            </plugins>

        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>biz.aQute.bnd</groupId>
                <artifactId>bnd-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-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-release-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <inherited>false</inherited>
                <configuration>
                    <failIfMissing>true</failIfMissing>
                    <aggregate>true</aggregate>
                    <strictCheck>true</strictCheck>
                    <properties>
                        <copyright-range>${project.inceptionYear}-2021</copyright-range>
                    </properties>
                </configuration>
                <executions>
                    <execution>
                        <id>check-java-headers</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <header>header-template-lgpl-java.txt</header>
                            <mapping>
                                <java>SLASHSTAR_STYLE</java>
                            </mapping>
                            <includes>
                                <include>**/*.java</include>
                            </includes>
                            <excludes>
                            </excludes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>check-c-headers-and-sources</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <header>header-template-lgpl-java.txt</header>
                            <mapping>
                                <c>SLASHSTAR_STYLE</c>
                            </mapping>
                            <includes>
                                <include>**/*.c</include>
                                <include>**/*.h</include>
                            </includes>
                            <excludes>
                                <exclude>**/jni-includes/**</exclude>
                                <exclude>**/.ccls-cache/**</exclude>
                                <exclude>de.ibapl.spsw.jniprovider/config.h</exclude>
                                <exclude>de.ibapl.spsw.jniprovider/src/main/native/include/*.h</exclude>
                            </excludes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
