<?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.openeuler</groupId>
    <artifactId>gmssl</artifactId>
    <packaging>pom</packaging>
    <version>2.0.4</version>

    <name>gmssl</name>
    <url>https://gitcode.com/openeuler/bgmprovider</url>
    <description>Java Support for GMTLS</description>

    <properties>
        <!-- Build settings -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>

        <!-- Main dependency versions -->
        <bouncycastle.version>1.84</bouncycastle.version>
        <tomcat.version>9.0.83</tomcat.version>

        <!-- Test dependency versions -->
        <httpclient.version>5.3</httpclient.version>
        <jakarta.servlet.version>5.0.0</jakarta.servlet.version>
        <jetty.version>9.4.55.v20240627</jetty.version>
        <javax.servlet.version>2.5</javax.servlet.version>
        <junit.version>4.13.2</junit.version>
        <netty.version>4.1.109.Final</netty.version>
        <slf4j.version>1.7.36</slf4j.version>

        <!-- Benchmark dependency versions -->
        <jmh.version>1.37</jmh.version>

        <!-- Maven plugin versions -->
        <central.publishing.maven.plugin.version>0.8.0</central.publishing.maven.plugin.version>
        <jacoco.maven.plugin.version>0.8.12</jacoco.maven.plugin.version>
        <maven.clean.plugin.version>3.1.0</maven.clean.plugin.version>
        <maven.assembly.plugin.version>3.7.1</maven.assembly.plugin.version>
        <maven.compiler.plugin.version>3.8.0</maven.compiler.plugin.version>
        <maven.deploy.plugin.version>2.8.2</maven.deploy.plugin.version>
        <maven.gpg.plugin.version>1.6</maven.gpg.plugin.version>
        <maven.install.plugin.version>2.5.2</maven.install.plugin.version>
        <maven.jar.plugin.version>3.1.2</maven.jar.plugin.version>
        <maven.javadoc.plugin.version>3.12.0</maven.javadoc.plugin.version>
        <maven.project.info.reports.plugin.version>3.0.0</maven.project.info.reports.plugin.version>
        <maven.resources.plugin.version>3.3.1</maven.resources.plugin.version>
        <maven.shade.plugin.version>3.2.1</maven.shade.plugin.version>
        <maven.site.plugin.version>3.7.1</maven.site.plugin.version>
        <maven.source.plugin.version>2.2.1</maven.source.plugin.version>
        <maven.surefire.plugin.version>3.2.5</maven.surefire.plugin.version>
        <native.maven.plugin.version>1.0-M1</native.maven.plugin.version>
        <versions.maven.plugin.version>2.7</versions.maven.plugin.version>
        <maven.antrun.plugin.version>3.2.0</maven.antrun.plugin.version>
        <properties.maven.plugin.version>1.3.0</properties.maven.plugin.version>

        <!-- Runtime-injected options -->
        <jacoco.maven.plugin.argLine/>
        <jdk.module.options/>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- Project modules -->
            <dependency>
                <groupId>org.openeuler</groupId>
                <artifactId>bgmprovider</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.openeuler</groupId>
                <artifactId>commons</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.openeuler</groupId>
                <artifactId>jca</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.openeuler</groupId>
                <artifactId>jsse</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.openeuler</groupId>
                <artifactId>sdfprovider</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- Main dependencies -->
            <dependency>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcprov-jdk18on</artifactId>
                <version>${bouncycastle.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-coyote</artifactId>
                <version>${tomcat.version}</version>
            </dependency>

            <!-- Test dependencies -->
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-handler</artifactId>
                <version>${netty.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>jakarta.servlet</groupId>
                <artifactId>jakarta.servlet-api</artifactId>
                <version>${jakarta.servlet.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>servlet-api</artifactId>
                <version>${javax.servlet.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents.client5</groupId>
                <artifactId>httpclient5</artifactId>
                <version>${httpclient.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-catalina</artifactId>
                <version>${tomcat.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-client</artifactId>
                <version>${jetty.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-server</artifactId>
                <version>${jetty.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>${slf4j.version}</version>
                <scope>test</scope>
            </dependency>

            <!-- Benchmark dependencies -->
            <dependency>
                <groupId>org.openjdk.jmh</groupId>
                <artifactId>jmh-core</artifactId>
                <version>${jmh.version}</version>
            </dependency>
            <dependency>
                <groupId>org.openjdk.jmh</groupId>
                <artifactId>jmh-generator-annprocess</artifactId>
                <version>${jmh.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <build>
        <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>${maven.clean.plugin.version}</version>
                </plugin>
                <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven.resources.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-surefire-plugin</artifactId>
                    <version>${maven.surefire.plugin.version}</version>
                    <configuration>
                        <forkCount>0.5C</forkCount>
                        <parallel>none</parallel>
                        <reuseForks>false</reuseForks>
                        <forkedProcessTimeoutInSeconds>180</forkedProcessTimeoutInSeconds>
                        <redirectTestOutputToFile>true</redirectTestOutputToFile>
                        <goal>aggregate</goal>
                        <argLine>
                            @{jacoco.maven.plugin.argLine}
                            @{jdk.module.options}
                        </argLine>
                    </configuration>
                </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-assembly-plugin</artifactId>
                    <version>${maven.assembly.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${maven.install.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven.deploy.plugin.version}</version>
                </plugin>
                <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>${maven.site.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>${maven.project.info.reports.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven.source.plugin.version}</version>
                    <configuration>
                        <includePom>true</includePom>
                        <excludeResources>true</excludeResources>
                        <attach>true</attach>
                    </configuration>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <phase>package</phase>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven.javadoc.plugin.version}</version>
                    <configuration>
                        <show>private</show>
                        <nohelp>true</nohelp>
                        <charset>UTF-8</charset>
                        <encoding>UTF-8</encoding>
                        <docencoding>UTF-8</docencoding>
                        <doclint>none</doclint>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!--                version modification plugins-->
                <!--                the following maven commands should be executed in the root directory of the project-->
                <!--                1)set version: mvn versions:set -DnewVersion=XXX-->
                <!--                2)revert version: mvn versions:revert-->
                <!--                3)commit version: mvn versions:commit-->
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>${versions.maven.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco.maven.plugin.version}</version>
                    <executions>
                        <execution>
                            <id>prepare-agent</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                            <configuration>
                                <propertyName>jacoco.maven.plugin.argLine</propertyName>
                            </configuration>
                        </execution>
                        <execution>
                            <id>report</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>report</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>native-maven-plugin</artifactId>
                    <version>${native.maven.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>${maven.shade.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>${maven.antrun.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>properties-maven-plugin</artifactId>
                    <version>${properties.maven.plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <!--surefire-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>

            <!-- Java source -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>

            <!-- Javadoc -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>

            <!-- jacoco -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <licenses>
        <license>
            <name>GPLv2 with Classpath Exception</name>
            <url>https://openjdk.java.net/legal/gplv2+ce.html</url>
        </license>
    </licenses>
    <scm>
        <connection>https://gitcode.com/openeuler/bgmprovider.git</connection>
        <url>https://gitcode.com/openeuler/bgmprovider</url>
    </scm>
    <developers>
        <developer>
            <name>BGMProvider</name>
            <email>bgmprovider@163.com</email>
            <roles>
                <role>Developer</role>
            </roles>
            <timezone>+8</timezone>
        </developer>
    </developers>
    <profiles>
        <profile>
            <id>default</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <modules>
                <module>jca</module>
                <module>jsse</module>
                <module>bgmprovider</module>
                <module>tomcat-adaptor</module>
                <module>commons</module>
            </modules>
        </profile>
        <profile>
            <id>sdf</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <modules>
                <module>jca</module>
                <module>jsse</module>
                <module>bgmprovider</module>
                <module>tomcat-adaptor</module>
                <module>commons</module>
                <module>sdfprovider</module>
            </modules>
        </profile>
        <profile>
            <id>release</id>
            <modules>
                <module>jca</module>
                <module>jsse</module>
                <module>bgmprovider</module>
                <module>tomcat-adaptor</module>
                <module>commons</module>
                <module>sdfprovider</module>
            </modules>
            <build>
                <plugins>
                    <!-- GPG -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven.gpg.plugin.version}</version>
                        <executions>
                            <execution>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- sonatype central plugin -->
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>${central.publishing.maven.plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <autoPublish>true</autoPublish>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <distributionManagement>
                <!-- After using central-publishing-maven-plugin, this can be ignored, only a prompt. -->
                <repository>
                    <id>central</id>
                    <name>Central Portal Repository</name>
                    <url>https://central.sonatype.com/repository/maven-snapshots/</url>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </distributionManagement>
        </profile>
    </profiles>
</project>