<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.red5</groupId>
    <artifactId>moq-cmaf</artifactId>
    <version>1.1.2</version>
    <packaging>jar</packaging>
    <name>MoQ CMAF Packaging</name>
    <description>Pure Java implementation of MoQ CMAF packaging library for serialization/deserialization of audio, video, and metadata content</description>
    <url>https://github.com/Red5/red5-server</url>
    <organization>
        <name>Red5</name>
        <url>https://github.com/Red5</url>
    </organization>
    <licenses>
        <license>
            <name>Apache 2</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>
    <scm>
        <url>https://github.com/Red5/red5-moq-cmaf.git</url>
        <connection>scm:git:git@github.com:Red5/red5-moq-cmaf.git</connection>
        <developerConnection>scm:git:git@github.com:Red5/red5-moq-cmaf.git</developerConnection>
    </scm>
    <developers>
        <developer>
            <id>Paul Gregoire</id>
            <email>mondain@gmail.com</email>
        </developer>
    </developers>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.plugin.validation>brief</maven.plugin.validation>
        <!-- prevents the deploy goal from being executed accidentially -->
        <maven.deploy.skip>true</maven.deploy.skip>
        <!-- allows tests to be built and works in conjuction with skipTests property -->
        <maven.test.skip>false</maven.test.skip>
        <!-- prevents built tests from running -->
        <skipTests>false</skipTests>
        <maven.compiler.verbose>false</maven.compiler.verbose>
        <maven.compiler.release>21</maven.compiler.release>
        <maven.build.timestamp.format>MM.dd.yyyy HH:mm</maven.build.timestamp.format>
        <timestamp>${maven.build.timestamp}</timestamp>
        <junit.version>5.10.1</junit.version>
        <slf4j.version>2.0.9</slf4j.version>
    </properties>
    <repositories>
        <repository>
            <id>central</id>
            <name>Central Repository</name>
            <url>https://repo.maven.apache.org/maven2</url>
            <layout>default</layout>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>sonatype-snapshots</id>
            <name>Sonatype Snapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </repository>
        <repository>
            <id>sonatype-releases</id>
            <name>Sonatype Releases</name>
            <url>https://oss.sonatype.org/content/repositories/releases</url>
        </repository>
    </repositories>
    <dependencies>
        <!-- SLF4J API for logging -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
            <scope>compile</scope>
        </dependency>
        <!-- Logback for testing -->
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.4.14</version>
            <scope>test</scope>
        </dependency>
        <!-- JUnit 5 for testing -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.13.0</version>
                <configuration>
                    <verbose>true</verbose>
                    <release>${maven.compiler.release}</release>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.3.0</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Maven Surefire Plugin for running tests -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.2.2</version>
            </plugin>
            <!-- Maven JAR Plugin for standard JAR packaging -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.3.0</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
                            <includeScope>compile</includeScope>
                            <excludeTransitive>false</excludeTransitive>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>release</id>
            <!-- mvn clean deploy -P release -Dgpg.passphrase=[password] -DskipTests=true -->
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.11.3</version>
                        <configuration>
                            <verbose>false</verbose>
                            <release>${java.release.level}</release>
                            <failOnError>false</failOnError>
                            <failOnWarning>false</failOnWarning>
                            <failOnMissingJavadoc>false</failOnMissingJavadoc>
                            <failOnEmpty>false</failOnEmpty>
                            <warningAsError>false</warningAsError>
                            <warnOnMissingJavadocTag>false</warnOnMissingJavadocTag>
                            <failOnMissingSource>false</failOnMissingSource>
                            <failOnMissingPackage>false</failOnMissingPackage>
                            <failOnMissingMethod>false</failOnMissingMethod>
                            <failOnMissingConstructor>false</failOnMissingConstructor>
                            <failOnMissingType>false</failOnMissingType>
                            <failOnMissingTypeParameter>false</failOnMissingTypeParameter>
                            <failOnMissingParameter>false</failOnMissingParameter>
                            <failOnMissingReturn>false</failOnMissingReturn>
                            <tags>
                                <tag>
                                    <name>todo</name>
                                    <!-- todo tag for all places -->
                                    <placement>a</placement>
                                    <head>To do:</head>
                                </tag>
                            </tags>
                            <excludePackageNames>org.apache.*</excludePackageNames>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.8.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>ossrh</publishingServerId>
                            <autoPublish>true</autoPublish>
                        </configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.2.1</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <distributionManagement>
                <snapshotRepository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
                <repository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
        </profile>
    </profiles>
</project>
