Java Code Examples for org.apache.maven.execution.MavenExecutionRequest#setExecutionListener()

The following examples show how to use org.apache.maven.execution.MavenExecutionRequest#setExecutionListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MavenProjectConfigCollector.java    From helidon-build-tools with Apache License 2.0 6 votes vote down vote up
@Override
public void afterProjectsRead(MavenSession session) {
    if (ENABLED) {
        // Init state
        supportedProjectDir = null;
        projectConfig = null;
        debug("collector enabled");
        try {
            // Ensure that we support this project
            supportedProjectDir = assertSupportedProject(session);

            // Install our listener so we can know if compilation occurred and succeeded
            final MavenExecutionRequest request = session.getRequest();
            request.setExecutionListener(new EventListener(request.getExecutionListener()));
        } catch (IllegalStateException e) {
            supportedProjectDir = null;
        }
    } else {
        debug("collector disabled");
    }
}
 
Example 2
Source File: MavenExecutionUtils.java    From vertx-maven-plugin with Apache License 2.0 5 votes vote down vote up
private static MavenExecutionRequest getMavenExecutionRequest(MavenSession session, String phase) {
    MavenExecutionRequest request = DefaultMavenExecutionRequest.copy(session.getRequest());
    request.setStartTime(session.getStartTime());
    request.setExecutionListener(null);
    request.setGoals(ImmutableList.of(phase));
    return request;
}
 
Example 3
Source File: MavenExecutionUtils.java    From vertx-maven-plugin with Apache License 2.0 5 votes vote down vote up
private static MavenExecutionRequest getMavenExecutionRequest(MavenSession session, String phase) {
    MavenExecutionRequest request = DefaultMavenExecutionRequest.copy(session.getRequest());
    request.setStartTime(session.getStartTime());
    request.setExecutionListener(null);
    request.setGoals(ImmutableList.of(phase));
    return request;
}
 
Example 4
Source File: RunMojo.java    From wisdom with Apache License 2.0 5 votes vote down vote up
private MavenExecutionRequest getMavenExecutionRequest() {
    MavenExecutionRequest request = DefaultMavenExecutionRequest.copy(session.getRequest());
    request.setStartTime(session.getStartTime());
    request.setExecutionListener(null);
    if (! initialBuild  && session.getGoals().contains("clean")) {
        // Here the package phase is required to restore the runtime environment
        request.setGoals(ImmutableList.of("clean", "package", "wisdom:internal-run"));
    } else {
        // It is safer to re-execute the package phase to have the new classes...
        request.setGoals(ImmutableList.of("package", "wisdom:internal-run"));
    }
    return request;
}
 
Example 5
Source File: MojoSpy.java    From vertx-maven-plugin with Apache License 2.0 4 votes vote down vote up
public static void init(MavenExecutionRequest request) {
    request.setExecutionListener(new MojoSpy(request));
}
 
Example 6
Source File: MojoSpy.java    From vertx-maven-plugin with Apache License 2.0 4 votes vote down vote up
public static void init(MavenExecutionRequest request) {
    request.setExecutionListener(new MojoSpy(request));
}