<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.tongweb</groupId>
        <artifactId>tongweb-embed-external-3x</artifactId>
        <version>7.0.0</version>
    </parent>

    <groupId>com.tongweb.gmssl</groupId>
    <version>${embed.release.version}</version>
    <artifactId>tongweb-adaptor</artifactId>
    <packaging>jar</packaging>

    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.tongweb</groupId>
            <artifactId>tongweb-embed-core-3.x</artifactId>
            <version>${embed.release.version}</version>
            <scope>provided</scope>
        </dependency>


        <dependency>
            <groupId>org.openeuler</groupId>
            <artifactId>bgmprovider</artifactId>
            <version>1.1.2</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <version>5.0.0</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>test</scope>
        </dependency>

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

    <profiles>
        <profile>
            <id>jdk17</id>
            <activation>
                <jdk>17</jdk>
            </activation>
            <properties>
                <argLine>
                    --add-exports=java.base/sun.security.x509=ALL-UNNAMED
                    --add-exports=java.base/sun.security.action=ALL-UNNAMED
                    --add-opens=java.base/sun.security.util=ALL-UNNAMED
                    --add-exports=java.base/sun.security.pkcs=ALL-UNNAMED
                    --add-exports=java.base/jdk.internal.access=ALL-UNNAMED
                    --add-exports=java.base/sun.net.util=ALL-UNNAMED
                    --add-exports=java.base/sun.security.internal.spec=ALL-UNNAMED
                    --add-opens=java.base/javax.crypto=ALL-UNNAMED
                    --add-opens=java.base/sun.security.pkcs12=ALL-UNNAMED
                    --add-opens=java.base/java.nio=ALL-UNNAMED
                    --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED
                    --add-exports=java.base/sun.security.jca=ALL-UNNAMED
                </argLine>
            </properties>
        </profile>
        <profile>
            <id>jdk11</id>
            <activation>
                <jdk>11</jdk>
            </activation>
            <properties>
                <argLine>
                    --add-exports=java.base/jdk.internal.misc=ALL-UNNAMED
                    --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED
                    --add-exports=java.base/jdk.internal.access=ALL-UNNAMED
                </argLine>
            </properties>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.1</version>
                <configuration>
                    <forkCount>0.5C</forkCount>
                    <parallel>none</parallel>
                    <reuseForks>false</reuseForks>
                    <forkedProcessTimeoutInSeconds>90</forkedProcessTimeoutInSeconds>
                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
                    <goal>aggregate</goal>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <configuration>
                    <includePom>true</includePom>
                    <excludeResources>true</excludeResources>
                    <attach>true</attach>
                </configuration>
                <executions>
                    <execution>
                        <phase>verify</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
