<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>io.telicent.public</groupId>
    <artifactId>fuseki-yaml-config</artifactId>
    <packaging>jar</packaging>
    <version>2.0.2</version>

    <name>Fuseki YAML Config Parser</name>
    <description>Fuseki YAML config support</description>
    <url>https://github.com/telicent-oss/fuseki-yaml-config</url>

    <scm>
        <connection>scm:git:git:/https://github.com/telicent-oss/fuseki-yaml-config.git</connection>
        <developerConnection>scm:git:git@github.com:telicent-oss/fuseki-yaml-config.git</developerConnection>
        <url>https://github.com/telicent-oss/fuseki-yaml-config</url>
        <tag>2.0.2</tag>
    </scm>

    <licenses>
        <license>
            <name>Apache-2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Telicent Developers</name>
            <email>opensource@telicent.io</email>
            <organization>Telicent Ltd</organization>
            <organizationUrl>https://telicent.io</organizationUrl>
        </developer>
    </developers>

    <properties>
        <!-- Build properties -->
        <java.version>21</java.version>
        <license.header.path>${project.basedir}</license.header.path>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <!-- Internal dependencies -->
        <dependency.fuseki-kafka>3.0.4</dependency.fuseki-kafka>
        <dependency.jena>6.1.0</dependency.jena>
        <dependency.rdf-abac>3.1.2</dependency.rdf-abac>
        <!-- External dependencies -->
        <dependency.log4j2>2.25.3</dependency.log4j2>
        <dependency.snake-yaml>2.5</dependency.snake-yaml>
        <!-- Test dependencies -->
        <dependency.junit5>6.0.2</dependency.junit5>
        <dependency.junit5-platform>1.10.1</dependency.junit5-platform>
        <dependency.smart-caches-core>0.40.2</dependency.smart-caches-core>
        <dependency.test-containers>1.21.4</dependency.test-containers>
        <!-- CVE-2026-49268 - Apache Shiro is a transitive dependency of Apache Jena -->
        <dependency.shiro>2.2.1</dependency.shiro>
        <!-- Plugins -->
        <plugin.central>0.10.0</plugin.central>
        <plugin.compiler>3.15.0</plugin.compiler>
        <plugin.cyclonedx>2.9.1</plugin.cyclonedx>
        <plugin.gpg>3.2.8</plugin.gpg>
        <plugin.javadoc>3.12.0</plugin.javadoc>
        <plugin.license>5.0.0</plugin.license>
        <plugin.source>3.4.0</plugin.source>
        <plugin.surefire>3.5.4</plugin.surefire>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- CVE-2026-49268 - Apache Shiro is a transitive dependency of Apache Jena -->
            <dependency>
                <groupId>org.apache.shiro</groupId>
                <artifactId>shiro-core</artifactId>
                <version>${dependency.shiro}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- Internal dependencies -->
        <dependency>
            <groupId>io.telicent.jena</groupId>
            <artifactId>jena-fuseki-kafka-module</artifactId>
            <version>${dependency.fuseki-kafka}</version>
            <exclusions>
                <!-- CVE-2025-48976 -->
                <exclusion>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-fileupload2-jakarta-servlet6</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.telicent.jena</groupId>
            <artifactId>rdf-abac-core</artifactId>
            <version>${dependency.rdf-abac}</version>
        </dependency>

        <dependency>
            <groupId>io.telicent.jena</groupId>
            <artifactId>rdf-abac-fuseki</artifactId>
            <version>${dependency.rdf-abac}</version>
        </dependency>

        <!-- Jena -->
        <dependency>
            <groupId>org.apache.jena</groupId>
            <artifactId>jena-cmds</artifactId>
            <version>${dependency.jena}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.jena</groupId>
            <artifactId>jena-fuseki-main</artifactId>
            <version>${dependency.jena}</version>
        </dependency>

        <!-- External dependencies -->
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>${dependency.log4j2}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j2-impl</artifactId>
            <version>${dependency.log4j2}</version>
        </dependency>

        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>${dependency.snake-yaml}</version>
        </dependency>

        <!-- Test dependencies -->
        <dependency>
            <!--for the kafka helper-->
            <groupId>io.telicent.smart-caches</groupId>
            <artifactId>event-source-kafka</artifactId>
            <version>${dependency.smart-caches-core}</version>
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.telicent.jena</groupId>
            <artifactId>jena-fuseki-kafka-module</artifactId>
            <version>${dependency.fuseki-kafka}</version>
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${dependency.junit5}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${dependency.junit5}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>kafka</artifactId>
            <version>${dependency.test-containers}</version>
            <exclusions>
                <!-- CVE-2024-25710, CVE-2024-26308 -->
                <exclusion>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-compress</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${plugin.compiler}</version>
                <configuration>
                    <release>${java.version}</release>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${plugin.source}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${plugin.javadoc}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${plugin.surefire}</version>
                <configuration>
                    <includes>
                        <include>**/Test*.java</include>
                    </includes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>${plugin.gpg}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                        <phase>verify</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>${plugin.central}</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                    <autoPublish>true</autoPublish>
                    <waitUntil>published</waitUntil>
                    <waitTime>3600</waitTime>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.cyclonedx</groupId>
                <artifactId>cyclonedx-maven-plugin</artifactId>
                <version>${plugin.cyclonedx}</version>
                <executions>
                    <execution>
                        <id>build-sbom-cyclonedx</id>
                        <phase>package</phase>
                        <goals>
                            <goal>makeAggregateBom</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <outputName>${project.artifactId}-${project.version}-bom</outputName>
                    <skipNotDeployed>false</skipNotDeployed>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>${plugin.license}</version>
                <configuration>
                    <failIfMissing>true</failIfMissing>
                    <aggregate>false</aggregate>
                    <useDefaultMapping>true</useDefaultMapping>
                    <strictCheck>true</strictCheck>
                    <licenseSets>
                        <licenseSet>
                            <header>${license.header.path}/header.txt</header>
                            <excludes>
                                <exclude>header.txt</exclude>
                                <exclude>pom.xml</exclude>
                                <exclude>LICENSE</exclude>
                                <exclude>NOTICE</exclude>
                                <exclude>**/pom.xml</exclude>
                                <exclude>.github/**/*</exclude>
                                <exclude>**/*.state</exclude>
                                <exclude>**/*.trig</exclude>
                                <exclude>**/*.ttl</exclude>
                                <exclude>**/*.txt</exclude>
                                <exclude>**/*.yaml</exclude>
                                <exclude>DB2/**</exclude>
                                <exclude>.trivy/**</exclude>
                            </excludes>
                        </licenseSet>
                    </licenseSets>
                    <mapping>
                        <java>JAVADOC_STYLE</java>
                    </mapping>
                </configuration>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
    <profile>
        <id>docker</id>
        <activation>
            <activeByDefault>true</activeByDefault>
            <os>
                <family>!Windows</family>
            </os>
        </activation>

        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${plugin.surefire}</version>
                    <configuration>
                        <includes>
                            <include>**/Test*.java</include>
                            <include>**/DockerTest*.java</include>
                        </includes>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>
    </profiles>

    <distributionManagement>
        <snapshotRepository>
            <id>central</id>
            <name>Maven Central Snapshots</name>
            <url>https://central.sonatype.com/repository/maven-snapshots/</url>
        </snapshotRepository>
    </distributionManagement>
</project>
