[MNG-8283] Minor: method rename

This commit is contained in:
Tamas Cservenak 2024-10-04 18:05:13 +02:00
parent 60ae468a2e
commit 1817aaeaad
3 changed files with 6 additions and 12 deletions

View File

@ -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();

View File

@ -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;

View File

@ -114,7 +114,7 @@ public class DefaultResidentMavenInvoker
try {
validate(master);
prepare(master);
logging(master);
configureLogging(master);
container(master);
lookup(master);
return master;