1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-23 19:25:25 +03:00
aports/testing/sonar-scanner/fix-reflection.patch
2023-08-23 20:17:34 +00:00

22 lines
957 B
Diff

i'm not exactly sure why it fails, but without this running analysis fails with:
Caused by:
net.sf.cglib.core.CodeGenerationException:
java.lang.reflect.InaccessibleObjectException:
Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible:
module java.base does not "opens java.lang" to unnamed module @77774571
found the fix here: https://stackoverflow.com/a/41265267
diff --git a/src/main/assembly/bin/sonar-scanner b/src/main/assembly/bin/sonar-scanner
index 2d2c2cc..8affabc 100755
--- a/src/main/assembly/bin/sonar-scanner
+++ b/src/main/assembly/bin/sonar-scanner
@@ -64,6 +64,7 @@ project_home=`pwd`
#echo "Info: Using project $project_home"
exec "$java_cmd" \
+ --add-opens java.base/java.lang=ALL-UNNAMED \
-Djava.awt.headless=true \
$SONAR_SCANNER_OPTS \
$SONAR_SCANNER_DEBUG_OPTS \