<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>

    <artifactId>jsignpdf</artifactId>
    <packaging>jar</packaging>
    <name>${project.artifactId}</name>

    <parent>
        <groupId>com.github.kwart.jsign</groupId>
        <artifactId>jsignpdf-root</artifactId>
        <version>3.1.0-RC-1</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <properties>
        <exec.mainClass>net.sf.jsignpdf.Signer</exec.mainClass>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <argLine>
                        ${argLine}
                        -Dglass.platform=Monocle -Dmonocle.platform=Headless
                        -Dprism.order=sw
                    </argLine>
                    <!-- Isolate tests from the developer's real config (~/.config/jsignpdf). Otherwise a
                         persisted advanced.properties (e.g. engine=dss) leaks into tests that resolve the
                         default engine and sign with it. -->
                    <environmentVariables>
                        <JSIGNPDF_CONFIG_DIR>${project.build.directory}/test-config</JSIGNPDF_CONFIG_DIR>
                    </environmentVariables>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <includeScope>compile</includeScope>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.15</version>
                <executions>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>${exec.mainClass}</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <!-- Signing-engine SPI + shared model/core (compile). Engine implementations are discovered at
             runtime via ServiceLoader; the default OpenPDF engine is bundled by the distribution module
             and pulled in here at test scope so the in-module signing tests have an engine to run. -->
        <dependency>
            <groupId>com.github.kwart.jsign</groupId>
            <artifactId>jsignpdf-engine-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.github.kwart.jsign</groupId>
            <artifactId>jsignpdf-engine-openpdf</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.kwart.jsign</groupId>
            <artifactId>jsignpdf-engine-dss</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- JavaFX -->
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-controls</artifactId>
            <version>${openjfx.version}</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-fxml</artifactId>
            <version>${openjfx.version}</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-swing</artifactId>
            <version>${openjfx.version}</version>
        </dependency>

        <!--
          Platform-classified JavaFX natives are NOT declared here. The library jar published
          to Maven Central stays platform-neutral. The distribution module pulls the classifier
          jars it needs to assemble the cross-platform full ZIP.
        -->

        <dependency>
            <groupId>com.github.librepdf</groupId>
            <artifactId>openpdf</artifactId>
        </dependency>
        <dependency>
            <groupId>com.github.librepdf</groupId>
            <artifactId>openpdf-renderer</artifactId>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk18on</artifactId>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcpkix-jdk18on</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-cli</groupId>
            <artifactId>commons-cli</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.pdfbox</groupId>
            <artifactId>pdfbox</artifactId>
        </dependency>
        <dependency>
            <groupId>com.github.kwart.jsign</groupId>
            <artifactId>jsign-jpedal</artifactId>
        </dependency>
        <dependency>
            <groupId>com.github.kwart.jsign</groupId>
            <artifactId>jsign-pkcs11</artifactId>
        </dependency>
        <!-- D-Bus / XDG Desktop Portal (Linux sandbox file chooser) -->
        <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-native-unixsocket</artifactId>
            <version>${dbus-java.version}</version>
        </dependency>

        <dependency>
            <groupId>org.testfx</groupId>
            <artifactId>openjfx-monocle</artifactId>
            <version>21.0.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
