[ 
https://issues.apache.org/jira/browse/MBUILDCACHE-61?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17774282#comment-17774282
 ] 

Olivier Lamy edited comment on MBUILDCACHE-61 at 10/12/23 1:00 AM:
-------------------------------------------------------------------

Add `--add-opens java.base/sun.nio.ch=ALL-UNNAMED` in .mvn/jvm.config file
documentation added here 
https://github.com/apache/maven-build-cache-extension/commit/9a842bde58d49cf0294be6de9868dceb0eae8aa6#diff-ecb4b6db7bc09c2b02435d07c165dfb8d3cdcfb648e577e4e0d3f696846a096aR37


was (Author: olamy):
Add `--add-opens java.base/sun.nio.ch=ALL-UNNAMED` in .mvn/jvm.config file

> XXMM hash algorithm does not work on Java 17
> --------------------------------------------
>
>                 Key: MBUILDCACHE-61
>                 URL: https://issues.apache.org/jira/browse/MBUILDCACHE-61
>             Project: Maven Build Cache Extension
>          Issue Type: Bug
>          Components: remote build cache
>            Reporter: Benjamin Marwell
>            Priority: Major
>              Labels: documentation
>
> h2. Actual behaviour
> When trying to use XXMM, I get this error:
> {code:java}
> $ ./mvnw compile -Dmaven.build.cache.remote.save.enabled=true 
> -Daether.connector.http.supportWebDav=true[INFO] Loading cache configuration 
> from $HOME/Projects/git/my-app/.mvn/maven-build-cache-config.xml
> [INFO] Using XXMM hash algorithm for cache
> [INFO] Scanning for projects...
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Reactor Build Order:
> [...]
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Total time:  0.386 s
> [INFO] Finished at: 2023-06-12T11:58:13+02:00
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Saving cache report on build completion
> [INFO] Saved to remote cache 
> dav:http://my-server:8049/build-cache/my-app//v1/my-app.my-module/my-module/e1e4d804-879d-4d73-bbaa-b5ce13f77a39/build-cache-report.xml
> ---------------------------------------------------
> constituent[0]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/conf/logging/
> constituent[1]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/httpcore-4.4.16.jar
> constituent[2]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/plexus-utils-3.5.1.jar
> constituent[3]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/plexus-component-annotations-2.1.0.jar
> constituent[4]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/plexus-sec-dispatcher-2.0.jar
> constituent[5]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/slf4j-api-1.7.36.jar
> constituent[6]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/maven-settings-3.9.2.jar
> constituent[7]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/aopalliance-1.0.jar
> constituent[8]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/maven-model-3.9.2.jar
> constituent[9]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/maven-resolver-spi-1.9.10.jar
> constituent[10]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/javax.annotation-api-1.3.2.jar
> constituent[11]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/maven-embedder-3.9.2.jar
> constituent[12]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/maven-resolver-connector-basic-1.9.10.jar
> constituent[13]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/maven-resolver-named-locks-1.9.10.jar
> constituent[14]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/commons-cli-1.5.0.jar
> constituent[15]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/maven-model-builder-3.9.2.jar
> constituent[16]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/wagon-http-3.5.3.jar
> constituent[17]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/plexus-interpolation-1.26.jar
> constituent[18]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/plexus-cipher-2.0.jar
> constituent[19]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/maven-resolver-api-1.9.10.jar
> constituent[20]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/maven-resolver-transport-file-1.9.10.jar
> constituent[21]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/guice-5.1.0.jar
> constituent[22]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/maven-resolver-impl-1.9.10.jar
> constituent[23]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/maven-core-3.9.2.jar
> constituent[24]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/failureaccess-1.0.1.jar
> constituent[25]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/maven-builder-support-3.9.2.jar
> constituent[26]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/jcl-over-slf4j-1.7.36.jar
> constituent[27]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/maven-resolver-util-1.9.10.jar
> constituent[28]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/org.eclipse.sisu.inject-0.3.5.jar
> constituent[29]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/commons-codec-1.11.jar
> constituent[30]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/wagon-file-3.5.3.jar
> constituent[31]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/wagon-http-shared-3.5.3.jar
> constituent[32]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/maven-settings-builder-3.9.2.jar
> constituent[33]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/maven-plugin-api-3.9.2.jar
> constituent[34]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/maven-shared-utils-3.3.4.jar
> constituent[35]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/maven-compat-3.9.2.jar
> constituent[36]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/org.eclipse.sisu.plexus-0.3.5.jar
> constituent[37]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/maven-repository-metadata-3.9.2.jar
> constituent[38]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/wagon-provider-api-3.5.3.jar
> constituent[39]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/commons-lang3-3.12.0.jar
> constituent[40]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/guava-31.1-jre.jar
> constituent[41]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/maven-slf4j-provider-3.9.2.jar
> constituent[42]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/maven-resolver-transport-wagon-1.9.10.jar
> constituent[43]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/javax.inject-1.jar
> constituent[44]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/httpclient-4.5.14.jar
> constituent[45]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/maven-resolver-transport-http-1.9.10.jar
> constituent[46]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/jansi-2.4.0.jar
> constituent[47]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/maven-artifact-3.9.2.jar
> constituent[48]: 
> file:$HOME/.m2/wrapper/dists/apache-maven-3.9.2-bin/507e2f6e/apache-maven-3.9.2/lib/maven-resolver-provider-3.9.2.jar
> ---------------------------------------------------
> Exception in thread "main" java.lang.reflect.InvocationTargetException
>         at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
>         at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.base/java.lang.reflect.Method.invoke(Method.java:568)
>         at 
> org.apache.maven.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:53)
>         at 
> org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:152)
>         at 
> org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:76)
> Caused by: java.lang.IllegalAccessError: Class 
> net/openhft/hashing/LongHashFunction(unnamed module 0x0000000280D66B08) can 
> not access class sun/nio/ch/DirectBuffer(java.base) because module java.base 
> does not export package sun/nio/ch to module unnamed module 0x0000000280D66B08
>         at 
> net.openhft.hashing.LongHashFunction.hashByteBuffer(LongHashFunction.java:536)
>         at 
> net.openhft.hashing.LongHashFunction.hashBytes(LongHashFunction.java:530)
>         at org.apache.maven.buildcache.hash.XX$Checksum.digest(XX.java:83)
>         at 
> org.apache.maven.buildcache.hash.HashChecksum.digest(HashChecksum.java:58)
>         at 
> org.apache.maven.buildcache.checksum.MavenProjectInput.calculateChecksum(MavenProjectInput.java:260)
>         at 
> org.apache.maven.buildcache.DefaultProjectInputCalculator.calculateInputInternal(DefaultProjectInputCalculator.java:109)
>         at 
> org.apache.maven.buildcache.DefaultProjectInputCalculator.calculateInput(DefaultProjectInputCalculator.java:86)
>         at 
> org.apache.maven.buildcache.CacheControllerImpl.findCachedBuild(CacheControllerImpl.java:169)
>         at 
> org.apache.maven.buildcache.BuildCacheMojosExecutionStrategy.execute(BuildCacheMojosExecutionStrategy.java:117)
>         at 
> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:160)
>         at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:105)
>         at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:73)
>         at 
> org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:53)
>         at 
> org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:118)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:261)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:173)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:101)
>         at org.apache.maven.cli.MavenCli.execute(MavenCli.java:910)
>         at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:283)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:206)
>         at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
>         at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.base/java.lang.reflect.Method.invoke(Method.java:568)
>         at 
> org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:283)
>         at 
> org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:226)
>         at 
> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:407)
>         at 
> org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:348)
>         ... 7 more {code}
> Java version used:
> {code:java}
> $ java --version
> openjdk 17.0.6 2023-01-17
> IBM Semeru Runtime Open Edition 17.0.6.0 (build 17.0.6+10)
> Eclipse OpenJ9 VM 17.0.6.0 (build openj9-0.36.0, JRE 17 Mac OS X 
> aarch64-64-Bit 20230117_255 (JIT enabled, AOT enabled)
> OpenJ9   - e68fb241f
> OMR      - f491bbf6f
> JCL      - 927b34f84c8 based on jdk-17.0.6+10) {code}
> Also happens on non-OpenJ9 (i.e. hotspot-based JVMs):
> {code:java}
> $ java --version
> openjdk 17.0.7 2023-04-18
> OpenJDK Runtime Environment Temurin-17.0.7+7 (build 17.0.7+7)
> OpenJDK 64-Bit Server VM Temurin-17.0.7+7 (build 17.0.7+7, mixed mode) {code}
> h2. Expected behaviour
> Can use XXMM.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to