<commit_before>package hudson.maven.agent;

import hudson.remoting.Callable;

/**
 * Starts Maven CLI. Remotely executed.
 *
 * @author <NAME>
 */
public class RunCommand implements Callable {
    private final String[] args;

    public RunCommand(String... args) {
        this.args = args;
    }

    public Object call() throws Throwable {
        // return Main.class.getClassLoader().toString();
        return Main.launch(args);
    }
}<commit_msg>updated the test to use the listener.<commit_after>package hudson.maven.agent;

import hudson.remoting.Callable;
import org.apache.maven.project.MavenProject;
import org.apache.maven.plugin.MojoExecution;
import org.codehaus.plexus.configuration.PlexusConfiguration;
import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator;

import java.io.IOException;

/**
 * Starts Maven CLI. Remotely executed.
 *
 * @author <NAME>
 */
public class RunCommand implements Callable {
    private final String[] args;

    public RunCommand(String... args) {
        this.args = args;
    }

    public Object call() throws Throwable {
        // return Main.class.getClassLoader().toString();

        PluginManagerInterceptor.setListener(new PluginManagerListener() {
            public void preExecute(MavenProject project, MojoExecution exec, PlexusConfiguration mergedConfig, ExpressionEvaluator eval) throws IOException, InterruptedException, AbortException {
                System.out.println("***** "+exec.getMojoDescriptor().getGoal());
            }

            public void postExecute(MavenProject project, MojoExecution exec, PlexusConfiguration mergedConfig, ExpressionEvaluator eval) throws IOException, InterruptedException, AbortException {
                System.out.println("==== "+exec.getMojoDescriptor().getGoal());
            }
        });

        return Main.launch(args);
    }
}
{'fraction_non_alphanumeric': 0.10636023516835917, 'fraction_numerical': 0.0, 'mean_word_length': 3.467780429594272, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6438169', 'n_tokens_mistral': 519, 'n_tokens_neox': 495, 'n_words': 118}