<?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.openeuler</groupId>
        <artifactId>gmssl</artifactId>
        <version>1.1.4</version>
    </parent>

    <artifactId>jca</artifactId>
    <packaging>jar</packaging>

    <name>jca</name>
    <url>https://gitee.com/openeuler/bgmprovider</url>

    <properties>

    </properties>

    <dependencies>
        <dependency>
            <groupId>org.openeuler</groupId>
            <artifactId>commons</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk18on</artifactId>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>jdk21</id>
            <activation>
                <jdk>21</jdk>
            </activation>
            <properties>
                <argLine>
                    --add-exports=java.base/sun.security.x509=ALL-UNNAMED
                    --add-exports=java.base/sun.security.util=ALL-UNNAMED
                    --add-exports=java.base/com.sun.crypto.provider=ALL-UNNAMED
                    --add-opens=java.base/sun.security.util=ALL-UNNAMED
                    --add-opens=java.base/com.sun.crypto.provider=ALL-UNNAMED
                    --add-opens=java.base/javax.crypto=ALL-UNNAMED
                    --add-exports=java.base/sun.security.pkcs=ALL-UNNAMED
                    --add-exports=java.base/sun.security.jca=ALL-UNNAMED
                    --add-exports=jdk.crypto.ec/sun.security.ec=ALL-UNNAMED
                    --add-exports=java.base/sun.security.jca=ALL-UNNAMED
                </argLine>
            </properties>
        </profile>
        <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.util=ALL-UNNAMED
                    --add-exports=java.base/com.sun.crypto.provider=ALL-UNNAMED
                    --add-opens=java.base/sun.security.util=ALL-UNNAMED
                    --add-opens=java.base/com.sun.crypto.provider=ALL-UNNAMED
                    --add-opens=java.base/javax.crypto=ALL-UNNAMED
                    --add-exports=java.base/sun.security.pkcs=ALL-UNNAMED
                    --add-exports=java.base/sun.security.jca=ALL-UNNAMED
                    --add-exports=jdk.crypto.ec/sun.security.ec=ALL-UNNAMED
                    --add-exports=java.base/sun.security.jca=ALL-UNNAMED
                </argLine>
            </properties>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <argLine>${argLine}</argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>verify</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
