Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ public int doMain(CliRequest cliRequest) {
initialize(cliRequest);
cli(cliRequest);
properties(cliRequest);
setupGuiceClassLoading();
logging(cliRequest);
informativeCommands(cliRequest);
version(cliRequest);
Expand Down Expand Up @@ -475,6 +476,16 @@ private CommandLine cliMerge(CommandLine mavenConfig, CommandLine mavenCli) {
return commandLineBuilder.build();
}

/**
* 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.
*/
void setupGuiceClassLoading() {
if (System.getProperty("guice_custom_class_loading", "").trim().isEmpty()) {
System.setProperty("guice_custom_class_loading", "CHILD");
}
}

/**
* configure logging
*/
Expand Down
Loading