This is an automated email from the ASF dual-hosted git repository.

cstamas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven.git


The following commit(s) were added to refs/heads/master by this push:
     new 1817aaeaad [MNG-8283] Minor: method rename
1817aaeaad is described below

commit 1817aaeaadb24ba4f5cf7e0059c21ad3e7e2bdb3
Author: Tamas Cservenak <ta...@cservenak.net>
AuthorDate: Fri Oct 4 18:05:13 2024 +0200

    [MNG-8283] Minor: method rename
---
 .../java/org/apache/maven/cling/invoker/LookupInvoker.java   |  4 ++--
 .../apache/maven/cling/invoker/mvn/DefaultMavenInvoker.java  | 12 +++---------
 .../invoker/mvn/resident/DefaultResidentMavenInvoker.java    |  2 +-
 3 files changed, 6 insertions(+), 12 deletions(-)

diff --git 
a/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java 
b/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java
index b7d5620f9c..3411c4604d 100644
--- a/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java
+++ b/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java
@@ -156,7 +156,7 @@ public abstract class LookupInvoker<
             try {
                 validate(context);
                 prepare(context);
-                logging(context);
+                configureLogging(context);
                 activateLogging(context);
 
                 if (invokerRequest.options().help().isPresent()) {
@@ -208,7 +208,7 @@ public abstract class LookupInvoker<
 
     protected void prepare(C context) throws Exception {}
 
-    protected void logging(C context) throws Exception {
+    protected void configureLogging(C context) throws Exception {
         R invokerRequest = context.invokerRequest;
         // LOG COLOR
         Options mavenOptions = invokerRequest.options();
diff --git 
a/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvn/DefaultMavenInvoker.java
 
b/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvn/DefaultMavenInvoker.java
index 271304b227..58d9c388b7 100644
--- 
a/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvn/DefaultMavenInvoker.java
+++ 
b/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvn/DefaultMavenInvoker.java
@@ -23,6 +23,7 @@ import java.nio.file.Files;
 import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -39,7 +40,6 @@ import org.apache.maven.api.cli.mvn.MavenOptions;
 import org.apache.maven.building.FileSource;
 import org.apache.maven.building.Problem;
 import org.apache.maven.cli.CLIReportingUtils;
-import org.apache.maven.cli.event.DefaultEventSpyContext;
 import org.apache.maven.cli.event.ExecutionEventLogger;
 import org.apache.maven.cling.invoker.LookupInvoker;
 import org.apache.maven.cling.invoker.ProtoLookup;
@@ -135,14 +135,13 @@ public abstract class DefaultMavenInvoker<
     @Override
     protected void init(C context) throws Exception {
         MavenInvokerRequest<O> invokerRequest = context.invokerRequest;
-        DefaultEventSpyContext eventSpyContext = new DefaultEventSpyContext();
-        Map<String, Object> data = eventSpyContext.getData();
+        Map<String, Object> data = new HashMap<>();
         data.put("plexus", context.lookup.lookup(PlexusContainer.class));
         data.put("workingDirectory", invokerRequest.cwd().toString());
         data.put("systemProperties", 
toProperties(invokerRequest.systemProperties()));
         data.put("userProperties", 
toProperties(invokerRequest.userProperties()));
         data.put("versionProperties", CLIReportingUtils.getBuildProperties());
-        context.eventSpyDispatcher.init(eventSpyContext);
+        context.eventSpyDispatcher.init(() -> data);
     }
 
     @Override
@@ -443,11 +442,6 @@ public abstract class DefaultMavenInvoker<
     protected int doExecute(C context) throws Exception {
         MavenExecutionRequest request = context.mavenExecutionRequest;
 
-        // why? No way to disable caching?
-        if (context.mavenExecutionRequest.getRepositoryCache() == null) {
-            context.mavenExecutionRequest.setRepositoryCache(new 
DefaultRepositoryCache());
-        }
-
         context.eventSpyDispatcher.onEvent(request);
 
         MavenExecutionResult result;
diff --git 
a/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvn/resident/DefaultResidentMavenInvoker.java
 
b/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvn/resident/DefaultResidentMavenInvoker.java
index 71973eb439..60bf9729d0 100644
--- 
a/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvn/resident/DefaultResidentMavenInvoker.java
+++ 
b/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvn/resident/DefaultResidentMavenInvoker.java
@@ -114,7 +114,7 @@ public class DefaultResidentMavenInvoker
                     try {
                         validate(master);
                         prepare(master);
-                        logging(master);
+                        configureLogging(master);
                         container(master);
                         lookup(master);
                         return master;

Reply via email to