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

    <groupId>io.github.eduramiba</groupId>
    <artifactId>webcam-capture-driver-native</artifactId>
    <version>1.1.0</version>
    <modelVersion>4.0.0</modelVersion>
    <packaging>jar</packaging>

    <name>Webcam Capture Driver Native</name>
    <description>Native driver for Webcam-capture project</description>
    <inceptionYear>2021</inceptionYear>
    <url>https://github.com/eduramiba/webcam-capture-driver-native</url>

     <!-- Licenses -->
    <licenses>
        <license>
            <name>Apache 2.0</name>
            <url>http://www.opensource.org/licenses/Apache-2.0</url>
            <comments>Apache License, Version 2.0</comments>
        </license>
    </licenses>
    
    <!-- SCM -->
    <scm>
        <connection>scm:git:git://github.com/eduramiba/webcam-capture-driver-native.git</connection>
        <developerConnection>scm:git:git@github.com:eduramiba/webcam-capture-driver-native.git</developerConnection>
        <url>https://github.com/eduramiba/webcam-capture-driver-native</url>
    </scm>
    
    <!-- Developers -->
    <developers>
        <developer>
            <id>eduramiba</id>
            <name>Eduardo Ramos</name>
            <email>eduramiba@gmail.com</email>
        </developer>
    </developers>
    

    <properties>
        <java.version>11</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <!-- Dependencies versions -->
        <driver.slf4j.version>2.0.16</driver.slf4j.version>

        <driver.webcam-capture.version>0.3.13-SNAPSHOT</driver.webcam-capture.version>
        <driver.aalto-xml.version>1.3.3</driver.aalto-xml.version>
        <driver.jna.version>5.15.0</driver.jna.version>

        <driver.javafx.version>19</driver.javafx.version>

        <!-- Plugins versions -->
        <driver.maven-compiler-plugin.version>3.13.0</driver.maven-compiler-plugin.version>
        <driver.maven-assembly-plugin.version>3.7.1</driver.maven-assembly-plugin.version>
        <driver.maven-clean-plugin.version>3.4.0</driver.maven-clean-plugin.version>
        <driver.maven-deploy-plugin.version>3.1.3</driver.maven-deploy-plugin.version>
        <driver.maven-install-plugin.version>3.1.3</driver.maven-install-plugin.version>
        <driver.maven-jar-plugin.version>3.4.2</driver.maven-jar-plugin.version>
        <driver.maven-dependency-plugin.version>3.8.1</driver.maven-dependency-plugin.version>
        <driver.maven-resources-plugin.version>3.3.1</driver.maven-resources-plugin.version>
        <driver.copy-rename-maven-plugin.version>1.0.1</driver.copy-rename-maven-plugin.version>
        <driver.maven-site-plugin.version>3.21.0</driver.maven-site-plugin.version>
        <driver.build-helper-maven-plugin.version>3.6.0</driver.build-helper-maven-plugin.version>
        <driver.maven-surefire-plugin.version>3.5.2</driver.maven-surefire-plugin.version>
        <driver.maven-failsafe-plugin.version>3.5.2</driver.maven-failsafe-plugin.version>
        <driver.maven-exec-plugin.version>3.5.0</driver.maven-exec-plugin.version>
        <driver.modernizer-plugin.version>2.9.0</driver.modernizer-plugin.version>
        <driver.versions-maven-plugin.version>2.18.0</driver.versions-maven-plugin.version>
        <driver.help-maven-plugin.version>3.5.1</driver.help-maven-plugin.version>
        <driver.maven-enforcer-plugin.version>3.5.0</driver.maven-enforcer-plugin.version>
        <driver.maven-enforcer-plugin.extra-rules.version>1.9.0</driver.maven-enforcer-plugin.extra-rules.version>
        <driver.errorprone-plugin.version>2.16</driver.errorprone-plugin.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.github.sarxos</groupId>
                <artifactId>webcam-capture</artifactId>
                <version>${driver.webcam-capture.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>net.java.dev.jna</groupId>
                <artifactId>jna</artifactId>
                <version>${driver.jna.version}</version>
            </dependency>
            <dependency>
                <groupId>net.java.dev.jna</groupId>
                <artifactId>jna-platform</artifactId>
                <version>${driver.jna.version}</version>
            </dependency>

            <dependency>
                <groupId>com.fasterxml</groupId>
                <artifactId>aalto-xml</artifactId>
                <version>${driver.aalto-xml.version}</version>
            </dependency>

            <dependency>
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-graphics</artifactId>
                <version>${driver.javafx.version}</version>
            </dependency>

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

    <dependencies>
        <dependency>
            <groupId>com.github.sarxos</groupId>
            <artifactId>webcam-capture</artifactId>
        </dependency>

        <dependency>
            <groupId>net.java.dev.jna</groupId>
            <artifactId>jna</artifactId>
        </dependency>
        <dependency>
            <groupId>net.java.dev.jna</groupId>
            <artifactId>jna-platform</artifactId>
        </dependency>

        <dependency>
            <groupId>com.fasterxml</groupId>
            <artifactId>aalto-xml</artifactId>
        </dependency>

        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-graphics</artifactId>
            <scope>provided</scope>
        </dependency>

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

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${driver.maven-compiler-plugin.version}</version>
                    <configuration>
                        <source>${java.version}</source>
                        <target>${java.version}</target>
                        <release>${java.version}</release>                        <!-- Ensure Java version compatibility by checking APIs used -->
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>${driver.maven-assembly-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>${driver.maven-clean-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${driver.maven-deploy-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${driver.maven-install-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${driver.maven-jar-plugin.version}</version>
                    <configuration>
                        <archive>
                            <manifestEntries>
                                <Automatic-Module-Name>io.github.eduramiba.webcamcapture</Automatic-Module-Name>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>${driver.maven-dependency-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${driver.maven-resources-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>com.coderplus.maven.plugins</groupId>
                    <artifactId>copy-rename-maven-plugin</artifactId>
                    <version>${driver.copy-rename-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>${driver.maven-site-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>${driver.build-helper-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${driver.maven-surefire-plugin.version}</version>
                    <configuration>
                        <trimStackTrace>false</trimStackTrace>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${driver.maven-failsafe-plugin.version}</version>
                    <configuration>
                        <trimStackTrace>false</trimStackTrace>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>${driver.maven-exec-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.gaul</groupId>
                    <artifactId>modernizer-maven-plugin</artifactId>
                    <version>${driver.modernizer-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${driver.maven-enforcer-plugin.version}</version>
                </plugin>
                <plugin>
                    <!-- 
                    Check new versions with:
                    mvn versions:display-property-updates
                    -->
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>${driver.versions-maven-plugin.version}</version>
                    <configuration>
                        <!--suppress UnresolvedMavenProperty -->
                        <rulesUri>file:///${session.executionRootDirectory}/maven-version-rules.xml</rulesUri>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-help-plugin</artifactId>
                    <version>${driver.help-maven-plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${driver.maven-enforcer-plugin.version}</version>
                <executions>
                    <execution>
                        <id>maven-enforcer-check</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>[3.6.0,)</version>
                                    <message>Maven 3.6.0 or newer required</message>
                                </requireMavenVersion>
                                <enforceBytecodeVersion>
                                    <maxJdkVersion>${java.version}</maxJdkVersion>
                                    <ignoreClasses>
                                        <ignoreClass>module-info</ignoreClass>
                                    </ignoreClasses>
                                    <ignoredScopes>test</ignoredScopes>
                                </enforceBytecodeVersion>
                                <banCircularDependencies/>
                                <banDuplicateClasses>
                                    <findAllDuplicates>true</findAllDuplicates>
                                    <ignoreWhenIdentical>true</ignoreWhenIdentical>
                                </banDuplicateClasses>
                                <requireReleaseDeps>
                                    <message>No Snapshots Allowed For Release Versions</message>
                                    <onlyWhenRelease>true</onlyWhenRelease>
                                    <excludes>
                                        <exclude>com.github.sarxos:*</exclude>
                                    </excludes>
                                </requireReleaseDeps>
                                <dependencyConvergence/>
                                <reactorModuleConvergence>
                                    <message>The reactor is not valid</message>
                                    <ignoreModuleDependencies>true</ignoreModuleDependencies>
                                </reactorModuleConvergence>
                            </rules>
                            <fail>true</fail>
                            <failFast>true</failFast>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>extra-enforcer-rules</artifactId>
                        <version>${driver.maven-enforcer-plugin.extra-rules.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <!-- Checks uses of deprecated Java APIs and fails the build if any is 
                present -->
                <groupId>org.gaul</groupId>
                <artifactId>modernizer-maven-plugin</artifactId>
                <configuration>
                    <javaVersion>${java.version}</javaVersion>
                    <failOnViolations>true</failOnViolations>
                    <ignorePackages>org.driver.os.rest.security.html</ignorePackages>
                </configuration>
                <executions>
                    <execution>
                        <id>modernizer</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>modernizer</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${driver.maven-compiler-plugin.version}</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <release>${java.version}</release>                    <!-- Ensure Java version compatibility by checking APIs used -->
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <classifier>without-natives</classifier>
                            <excludes>
                                <exclude>darwin-*</exclude>
                                <exclude>linux-*</exclude>
                                <exclude>win32-*</exclude>
                                <exclude>**/*.dylib</exclude>
                                <exclude>**/*.so</exclude>
                                <exclude>**/*.dll</exclude>
                            </excludes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>check-error-prone</id>
            <activation>
                <jdk>[11,17)</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>${driver.maven-compiler-plugin.version}</version>
                        <configuration>
                            <source>${java.version}</source>
                            <target>${java.version}</target>
                            <release>${java.version}</release>                            <!-- Ensure Java version compatibility by checking APIs used -->
                            <compilerArgs>
                                <arg>-XDcompilePolicy=simple</arg>
                                <arg>-Xplugin:ErrorProne</arg>
                            </compilerArgs>
                            <annotationProcessorPaths>
                                <path>
                                    <groupId>com.google.errorprone</groupId>
                                    <artifactId>error_prone_core</artifactId>
                                    <version>${driver.errorprone-plugin.version}</version>
                                </path>
                            </annotationProcessorPaths>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>deployment</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <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>
                        <configuration>
                            <doclint>all,-missing</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-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <repositories>
        <repository>
            <id>Sonatype OSS Snapshot Repository</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </repository>
    </repositories>

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