<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">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.nextbreakpoint</groupId>
    <artifactId>com.nextbreakpoint.ffmpeg4java</artifactId>
    <version>7.0.1-1.2</version>
    <packaging>pom</packaging>
    <name>FFmpeg4Java</name>
    <description>FFmpeg4Java provides a Java wrapper of FFmpeg library</description>
    <url>https://github.com/nextbreakpoint/ffmpeg4java</url>
    <licenses>
        <license>
            <name>BSD 3</name>
            <url>http://nextbreakpoint.com/licenses/BSD3</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>Andrea Medeghini</name>
            <email>andrea@nextbreakpoint.com</email>
        </developer>
    </developers>
    <scm>
        <connection>scm:git:git@github.com:nextbreakpoint/ffmpeg4java.git</connection>
        <developerConnection>scm:git:git@github.com:nextbreakpoint/ffmpeg4java.git</developerConnection>
        <url>git@github.com:nextbreakpoint/ffmpeg4java.git</url>
    </scm>
    <properties>
        <java.version>22</java.version>
        <java.release>22</java.release>
        <maven.compiler.source>22</maven.compiler.source>
        <maven.compiler.target>22</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <junit.version>5.10.2</junit.version>
        <assertj.version>3.26.0</assertj.version>
        <mockito.version>5.12.0</mockito.version>
        <maven-source-plugin.version>3.3.1</maven-source-plugin.version>
        <maven-javadoc-plugin.version>3.7.0</maven-javadoc-plugin.version>
        <maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
        <maven-surefire-plugin.version>3.3.0</maven-surefire-plugin.version>
        <maven-toolchains-plugin.version>3.2.0</maven-toolchains-plugin.version>
        <maven-dependency-plugin.version>3.7.1</maven-dependency-plugin.version>
        <maven-enforcer-plugin.version>3.5.0</maven-enforcer-plugin.version>
        <maven-jar-plugin.version>3.4.1</maven-jar-plugin.version>
        <maven-gpg-plugin.version>1.5</maven-gpg-plugin.version>
        <versions-maven-plugin.version>2.16.2</versions-maven-plugin.version>
        <nexus-staging-maven-plugin.version>1.7.0</nexus-staging-maven-plugin.version>
        <github-release-plugin.version>1.6.0</github-release-plugin.version>
        <maven.version>3.6</maven.version>
        <github.draft>true</github.draft>
    </properties>
    <modules>
        <module>ffmpeg4java-macos</module>
        <module>ffmpeg4java-linux</module>
        <module>ffmpeg4java-windows</module>
    </modules>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-toolchains-plugin</artifactId>
                    <version>${maven-toolchains-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven-jar-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven-source-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>${maven-dependency-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${maven-enforcer-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>${versions-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>${nexus-staging-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>de.jutzig</groupId>
                    <artifactId>github-release-plugin</artifactId>
                    <version>${github-release-plugin.version}</version>
                    <configuration>
                        <releaseName>${project.name} ${project.version}</releaseName>
                        <tag>v${project.version}</tag>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-toolchains-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>toolchain</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <toolchains>
                        <jdk>
                            <version>[${java.version},)</version>
                        </jdk>
                    </toolchains>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <compilerArgs>
                        <arg>--enable-preview</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-versions</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>${maven.version}</version>
                                </requireMavenVersion>
                                <requireJavaVersion>
                                    <version>${java.version}</version>
                                </requireJavaVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <useSystemClassLoader>false</useSystemClassLoader>
                    <basedir>${project.basedir}</basedir>
                    <argLine>@{argLine}</argLine>
                    <forkCount>0</forkCount>
                    <properties>
                        <configurationParameters>
                            junit.jupiter.execution.parallel.enabled = true
                            junit.jupiter.execution.parallel.mode.default = same_thread
                            junit.jupiter.execution.parallel.mode.classes.default = concurrent
                            junit.jupiter.execution.parallel.config.strategy = fixed
                            junit.jupiter.execution.parallel.config.fixed.parallelism = 5
                        </configurationParameters>
                    </properties>
                    <includes>
                        <include>**/*Test.java</include>
                    </includes>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.surefire</groupId>
                        <artifactId>surefire-junit-platform</artifactId>
                        <version>${maven-surefire-plugin.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <includes>
                        <include>**/*.class</include>
                        <include>**/*.txt</include>
                    </includes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <configuration>
                    <rulesUri>file://${maven.multiModuleProjectDirectory}/maven-version-rules.xml</rulesUri>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${junit.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <profiles>
        <profile>
            <id>windows</id>
            <properties>
                <arch.type>x86_64</arch.type>
                <os.type>windows</os.type>
            </properties>
            <modules>
                <module>ffmpeg4java-tests</module>
                <module>ffmpeg4java-examples</module>
            </modules>
        </profile>
        <profile>
            <id>linux</id>
            <properties>
                <arch.type>x86_64</arch.type>
                <os.type>linux</os.type>
            </properties>
            <modules>
                <module>ffmpeg4java-tests</module>
                <module>ffmpeg4java-examples</module>
            </modules>
        </profile>
        <profile>
            <id>macos</id>
            <properties>
                <arch.type>x86_64</arch.type>
                <os.type>macos</os.type>
            </properties>
            <modules>
                <module>ffmpeg4java-tests</module>
                <module>ffmpeg4java-examples</module>
            </modules>
        </profile>
        <profile>
            <id>ossrh</id>
            <activation>
                <property>
                    <name>channel</name>
                    <value>ossrh</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <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>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <distributionManagement>
                <repository>
                    <id>ossrh</id>
                    <name>OSSRH</name>
                    <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
        </profile>
        <profile>
            <id>github</id>
            <activation>
                <property>
                    <name>channel</name>
                    <value>github</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>de.jutzig</groupId>
                        <artifactId>github-release-plugin</artifactId>
                        <configuration>
                            <releaseName>FFmpeg4Java ${project.version}</releaseName>
                            <tag>v${project.version}</tag>
                            <failOnExistingRelease>false</failOnExistingRelease>
                            <overwriteArtifact>false</overwriteArtifact>
                            <draft>${github.draft}</draft>
                            <fileSets>
                                <fileSet>
                                    <directory>${project.basedir}</directory>
                                    <includes>
                                        <include>**/target/${project.artifactId}-${project.version}-x86_64.jar</include>
                                    </includes>
                                </fileSet>
                            </fileSets>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
