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

    <parent>
        <groupId>com.github.oshi</groupId>
        <artifactId>oshi-parent</artifactId>
        <version>7.1.0</version>
    </parent>

    <artifactId>oshi-common</artifactId>
    <packaging>jar</packaging>

    <name>oshi-common</name>
    <description>Common API interfaces, abstract base classes, annotations, and utilities shared by all OSHI
        implementations. No native dependencies (neither JNA nor FFM). JDK 8 compatible.</description>

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

    <build>
        <plugins>
            <plugin>
                <groupId>biz.aQute.bnd</groupId>
                <artifactId>bnd-maven-plugin</artifactId>
                <configuration>
                    <bnd><![CDATA[Export-Package: oshi.*;-noimport:=true
                    Import-Package: ${osgi.slf4j.import.packages}, *
                    Bundle-SymbolicName: ${project.groupId}.${project.artifactId}
                    -snapshot: SNAPSHOT]]></bnd>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.github.siom79.japicmp</groupId>
                <artifactId>japicmp-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>cmp</goal>
                        </goals>
                        <phase>verify</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>de.thetaphi</groupId>
                <artifactId>forbiddenapis</artifactId>
                <configuration>
                    <failOnUnsupportedJava>false</failOnUnsupportedJava>
                    <bundledSignatures>
                        <bundledSignature>jdk-unsafe</bundledSignature>
                        <bundledSignature>jdk-deprecated</bundledSignature>
                        <bundledSignature>jdk-non-portable</bundledSignature>
                        <bundledSignature>jdk-reflection</bundledSignature>
                        <bundledSignature>jdk-system-out</bundledSignature>
                    </bundledSignatures>
                    <signaturesFiles>
                        <signaturesFile>${main.basedir}/config/forbidden-apis.txt</signaturesFile>
                        <signaturesFile>${main.basedir}/config/native-forbidden-apis.txt</signaturesFile>
                    </signaturesFiles>
                    <suppressAnnotations>
                        <suppressAnnotation>oshi.annotation.SuppressForbidden</suppressAnnotation>
                    </suppressAnnotations>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <executions>
                    <!-- Compile all sources at JDK 8 bytecode level for Maven Central release.
                         JDK 8 users can use this jar; module-info.java is excluded here
                         because release 8 predates JPMS and cannot compile it. -->
                    <execution>
                        <id>default-compile</id>
                        <configuration>
                            <excludes>
                                <exclude>module-info.java</exclude>
                            </excludes>
                        </configuration>
                    </execution>
                    <!-- Compile module-info.java separately at release 9 (minimum release
                         supporting JPMS). The resulting module-info.class is packaged into
                         the same jar alongside the JDK 8 class files. JDK 8 ignores
                         module-info.class; JDK 9+ uses it to resolve com.github.oshi.common
                         as a named module on the module path. -->
                    <execution>
                        <id>compile-module-info</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <release>9</release>
                            <includes>
                                <include>module-info.java</include>
                            </includes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
