Java 21 -> cannot access sun.security.pkcs11.wrapper.PKCS11Exception

已回答

Hi everyone,
I have a problem when maven compile java 21 project. My Project use  pkcs11 classes .
 My Configurations:
Plugins in pom.xml
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.11.0</version>
    <configuration>
        <source>${java.version}</source>
        <target>${java.version}</target>
    </configuration>
</plugin>

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>3.0.0-M5</version>
    <configuration>
        <argLine>@{argLine} --add-exports=java.base/sun.security.pkcs=ALL-UNNAMED --add-opens
            java.base/java.lang=ALL-UNNAMED --add-opens java.base/jdk.internal.reflect=ALL-UNNAMED
            --add-opens java.base/java.lang.reflect=ALL-UNNAMED
        </argLine>
        <properties>
            <argLine>-Dfile.encoding=UTF-8</argLine>
        </properties>
    </configuration>
</plugin>

Screenshot:

0

Hello, Omer!

Thank you for  reporting this!

Does the issue persist if you run Maven directly from the OS Command Prompt?

If it does, could you please run the Maven Lifecycle with extended logging (-X) and share the output (feel free to redact any sensitive data)?

0

请先登录再写评论。