[ https://issues.apache.org/jira/browse/MNG-8471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17910883#comment-17910883 ]
Scott M Stark commented on MNG-8471: ------------------------------------ Unfortunately this seems to be a function of how the maven archive was downloaded and the context it is run under. Whether or not the com.apple.quarantine attribute that causes this problem exists and is honored is a function of how the maven archive was downloaded and is accessed based on this article that talks about com.apple.quarantine attribute bypasses: [https://unit42.paloaltonetworks.com/gatekeeper-bypass-macos] I download the apache-maven-4.0.0-rc-2-bin.zip using my browser, and unzipped it using the macos unzip command. The downloaded zip and the library file in the unzipped directory have the com.apple.quarantine set: {noformat} starksm@Scotts-Mac-Studio pytorch-deep-learning % xattr -p com.apple.quarantine /tmp/apache-maven-4.0.0-rc-2-bin.zip 0081;677da25a;Vivaldi; starksm@Scotts-Mac-Studio pytorch-deep-learning % xattr -p com.apple.quarantine ~/bin/apache-maven-4.0.0-rc-2/lib/jline-native/Mac/arm64/libjlinenative.jnilib 0081;677da25a;Vivaldi; {noformat} I see the error if I run mvn from within a shell launched by Intellij: {noformat} starksm@Scotts-Mac-Studio spi % /tmp/apache-maven-4.0.0-rc-2/bin/mvn --version Jan 07, 2025 7:47:42 PM org.jline.nativ.JLineNativeLoader log WARNING: Failed to load native library:libjlinenative.jnilib. osinfo: Mac/arm64 (caused by: java.lang.UnsatisfiedLinkError: /private/tmp/apache-maven-4.0.0-rc-2/lib/jline-native/Mac/arm64/libjlinenative.jnilib: dlopen(/private/tmp/apache-maven-4.0.0-rc-2/lib/jline-native/Mac/arm64/libjlinenative.jnilib, 0x0001): tried: '/private/tmp/apache-maven-4.0.0-rc-2/lib/jline-native/Mac/arm64/libjlinenative.jnilib' (code signature in <E83722FF-713D-3654-A603-EEBC715887FE> '/private/tmp/apache-maven-4.0.0-rc-2/lib/jline-native/Mac/arm64/libjlinenative.jnilib' not valid for use in process: library load disallowed by system policy), '/System/Volumes/Preboot/Cryptexes/OS/private/tmp/apache-maven-4.0.0-rc-2/lib/jline-native/Mac/arm64/libjlinenative.jnilib' (no such file), '/private/tmp/apache-maven-4.0.0-rc-2/lib/jline-native/Mac/arm64/libjlinenative.jnilib' (code signature in <E83722FF-713D-3654-A603-EEBC715887FE> '/private/tmp/apache-maven-4.0.0-rc-2/lib/jline-native/Mac/arm64/libjlinenative.jnilib' not valid for use in process: library load disallowed by system policy), enable debug logging for stacktrace) Apache Maven 4.0.0-rc-2 (273314404f85ec3c089e295d8b4e0cb18c287cf5) Maven home: /private/tmp/apache-maven-4.0.0-rc-2 Java version: 23.0.1, vendor: Eclipse Adoptium, runtime: /Library/Java/JavaVirtualMachines/temurin-23.jdk/Contents/Home Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x", version: "15.1.1", arch: "aarch64", family: "mac"{noformat} However, if I launch mvn from within a Terminal.app shell, I do not see the error: {noformat} starksm@Scotts-Mac-Studio pytorch-deep-learning % /tmp/apache-maven-4.0.0-rc-2/bin/mvn --version Apache Maven 4.0.0-rc-2 (273314404f85ec3c089e295d8b4e0cb18c287cf5) Maven home: /private/tmp/apache-maven-4.0.0-rc-2 Java version: 23.0.1, vendor: Eclipse Adoptium, runtime: /Library/Java/JavaVirtualMachines/temurin-23.jdk/Contents/Home Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x", version: "15.1.1", arch: "aarch64", family: "mac" {noformat} If the apache-maven-4.0.0-rc-2-bin.zip archive is download with the curl command line utility, the archive does not have the com.apple.quarantine attribute set, and neither does the unarchived contents. The mvn command runs fine in either shell in that circumstance. > library load disallowed by system policy on Mac > ------------------------------------------------ > > Key: MNG-8471 > URL: https://issues.apache.org/jira/browse/MNG-8471 > Project: Maven > Issue Type: Bug > Affects Versions: 4.0.0-rc-2 > Reporter: Elliotte Rusty Harold > Priority: Blocker > Attachments: Screenshot 2024-12-25 at 6.10.01 PM.png > > > On a Mac with Sequoia 15.1.1 running the binary 4.0-RC2 release to "mvn clean > verify" the maven-compiler-plugin > {code} > WARNING: Failed to load native library:libjlinenative.jnilib. osinfo: > Mac/arm64 (caused by: java.lang.UnsatisfiedLinkError: > /opt/java/apache-maven-4.0.0-rc-2/lib/jline-native/Mac/arm64/libjlinenative.jnilib: > > dlopen(/opt/java/apache-maven-4.0.0-rc-2/lib/jline-native/Mac/arm64/libjlinenative.jnilib, > 0x0001): tried: > '/opt/java/apache-maven-4.0.0-rc-2/lib/jline-native/Mac/arm64/libjlinenative.jnilib' > (code signature in <E83722FF-713D-3654-A603-EEBC715887FE> > '/opt/java/apache-maven-4.0.0-rc-2/lib/jline-native/Mac/arm64/libjlinenative.jnilib' > not valid for use in process: library load disallowed by system policy), > '/System/Volumes/Preboot/Cryptexes/OS/opt/java/apache-maven-4.0.0-rc-2/lib/jline-native/Mac/arm64/libjlinenative.jnilib' > (no such file), > '/opt/java/apache-maven-4.0.0-rc-2/lib/jline-native/Mac/arm64/libjlinenative.jnilib' > (code signature in <E83722FF-713D-3654-A603-EEBC715887FE> > '/opt/java/apache-maven-4.0.0-rc-2/lib/jline-native/Mac/arm64/libjlinenative.jnilib' > not valid for use in process: library load disallowed by system policy), > enable debug logging for stacktrace) > {code} > The build still seems to complete normally. > openjdk version "17.0.12" 2024-07-16 > OpenJDK Runtime Environment Homebrew (build 17.0.12+0) > OpenJDK 64-Bit Server VM Homebrew (build 17.0.12+0, mixed mode, sharing) > Further, this isn't just a warning on the console. The mac actually pops up > two alert dialogs to warn about this problem that user must click away during > the build. > -- This message was sent by Atlassian Jira (v8.20.10#820010)