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

    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
    </parent>

    <groupId>org.jetbrains.nativecerts</groupId>
    <artifactId>jvm-native-trusted-roots</artifactId>
    <version>2.0.8</version>
    <packaging>jar</packaging>

    <name>Jvm Native Trusted Roots</name>
    <description>Platform-Native Trusted Certificates Handling</description>
    <url>https://github.com/JetBrains/jvm-native-trusted-roots</url>
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:https://github.com/JetBrains/jvm-native-trusted-roots.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/JetBrains/jvm-native-trusted-roots.git</developerConnection>
        <url>https://github.com/JetBrains/jvm-native-trusted-roots</url>
    </scm>

    <distributionManagement>
        <repository>
            <id>intellij-dependencies</id>
            <!-- provide url via the 'repositoryUrl' command-line arg -->
            <!--suppress MavenModelInspection -->
            <url>${repositoryUrl}</url>
        </repository>
    </distributionManagement>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compiler.release>25</maven.compiler.release>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <id>validate-create</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>create-metadata</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>create-metadata</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <!-- Install/Deploy metadata to Maven repository -->
                    <!-- https://www.mojohaus.org/buildnumber-maven-plugin/create-metadata-mojo.html#attach -->
                    <attach>true</attach>
                    <doCheck>false</doCheck>
                    <doUpdate>false</doUpdate>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.4.2</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Automatic-Module-Name>org.jetbrains.nativecerts</Automatic-Module-Name>
                            <Enable-Native-Access>ALL-UNNAMED</Enable-Native-Access>
                            <Build-Time>${maven.build.timestamp}</Build-Time>
                        </manifestEntries>
                        <manifestSections>
                            <manifestSection>
                                <name>Versions</name>
                                <manifestEntries>
                                    <Implementation-Version>${project.version}</Implementation-Version>
                                    <Implementation-SCM-Revision>${buildNumber}</Implementation-SCM-Revision>
                                </manifestEntries>
                            </manifestSection>
                        </manifestSections>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>3.7.1</version>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <archive>
                        <addMavenDescriptor>false</addMavenDescriptor>
                        <manifest>
                            <mainClass>org.jetbrains.nativecerts.NativeTrustedRootsDebugMain</mainClass>
                        </manifest>
                        <manifestEntries>
                            <Enable-Native-Access>ALL-UNNAMED</Enable-Native-Access>
                        </manifestEntries>
                    </archive>
                </configuration>
                <executions>
                    <execution>
                        <id>assemble-all</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.3.1</version>
                <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-compiler-plugin</artifactId>
                <version>3.13.0</version>
                <configuration>
                    <release>${maven.compiler.release}</release>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.11.2</version>
                <configuration>
                    <doclint>all,-missing</doclint>
                    <failOnWarnings>true</failOnWarnings>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.5.3</version>
                <configuration>
                    <argLine>--enable-native-access=ALL-UNNAMED --illegal-native-access=deny</argLine>
                    <systemPropertyVariables>
                        <java.util.logging.config.file>src/test/logging.properties</java.util.logging.config.file>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
            <version>26.0.1</version>
        </dependency>

        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcpkix-jdk18on</artifactId>
            <version>1.80</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
            <version>3.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
