File 0001-Set-Guice-class-loading-to-CHILD-avoid-using-termina.patch of Package maven4
--- a/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java
+++ b/impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java
@@ -150,6 +150,7 @@ protected int doInvoke(C context) throws Exception {
validate(context);
pushCoreProperties(context);
pushUserProperties(context);
+ setupGuiceClassLoading(context);
configureLogging(context);
createTerminal(context);
activateLogging(context);
@@ -248,6 +249,16 @@ protected void pushUserProperties(C context) throws Exception {
}
}
+ /**
+ * Sets up Guice class loading mode to CHILD, if not already set.
+ * Default Guice class loading mode uses a terminally deprecated JDK memory-access classes.
+ */
+ protected void setupGuiceClassLoading(C context) {
+ if (System.getProperty("guice_custom_class_loading", "").isBlank()) {
+ System.setProperty("guice_custom_class_loading", "CHILD");
+ }
+ }
+
protected void configureLogging(C context) throws Exception {
// LOG COLOR
Map<String, String> userProperties = context.protoSession.getUserProperties();