Skip to content

Conversation

@alaahong
Copy link
Member

@alaahong alaahong commented Mar 22, 2025

  1. change java version as default maven and spring format

As no usage of jdk.version in whole project, so remove and add new properties as traditional format

<java.version>1.8</java.version>
<maven.compiler.target>1.8</maven.compiler.target> 
<maven.compiler.source>1.8</maven.compiler.source>

reference:
#https://www.baeldung.com/maven-java-version

  1. fix the issue while working above java 9+ as java module mechanism limited. Just find out same behavior in github action confugration, so set below as comment in post commit

Add --add-opens for specific package into maven-surefire-plugin

<configuration>
    <argLine>
        --add-opens=java.base/java.lang=ALL-UNNAMED 
        --add-opens=java.base/java.util=ALL-UNNAMED 
        --add-opens=java.base/sun.reflect.annotation=ALL-UNNAMED
    </argLine>
</configuration>

e.g.
perform the unit test including reflection under java 21

mvn -Dtest=CacheDataTest test -D maven.test.skip=false

Before the change:
image

After the change:
image

reference:
--add-opens module/package=target-module(,target-module)* Updates module to open package to target-module, regardless of module declaration.
#https://docs.oracle.com/en/java/javase/17/docs/specs/man/java.html

1. change java version as default maven and spring format

As no declare jdk.version in whole project, so remove and add new properties

<java.version>1.8</java.version>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>

reference:
https://www.baeldung.com/maven-java-version

2. fix the issue while working above java 8+ as java module mechanism limited

Add --add-opens for specific package into maven-surefire-plugin

<configuration>
    <argLine>
        --add-opens java.base/sun.reflect.annotation=ALL-UNNAMED
    </argLine>
</configuration>

reference:
--add-opens module/package=target-module(,target-module)*
Updates module to open package to target-module, regardless of module declaration.
https://docs.oracle.com/en/java/javase/17/docs/specs/man/java.html
just comment the add-opens for ci verification
find out same behavior in .github action configuration, so just add as comment
@psxjoy psxjoy added the pending This problem needs to be confirmed label Mar 24, 2025
@psxjoy
Copy link
Member

psxjoy commented Mar 24, 2025

LGTM

@psxjoy psxjoy added good first issue Good for newcomers and removed pending This problem needs to be confirmed labels Mar 24, 2025
@psxjoy psxjoy merged commit 4af0a72 into apache:main Mar 24, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants