All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ru.yandex.qatools.camelot.maven.StopMojo Maven / Gradle / Ivy

There is a newer version: 2.5.4
Show newest version
package ru.yandex.qatools.camelot.maven;

import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.annotations.ResolutionScope;

import static ru.yandex.qatools.camelot.maven.service.CamelotRunner.camelot;

/**
 * @author Ilya Sadykov (mailto: [email protected])
 */
@Mojo(name = "stop", requiresDirectInvocation = true, requiresDependencyResolution = ResolutionScope.COMPILE)
public class StopMojo extends AbstractMojo {

    @Parameter(defaultValue = "8080")
    protected int jettyPort;

    @Override
    public void execute() throws MojoExecutionException, MojoFailureException {
        try {
            camelot().shutdown(jettyPort);
        } catch (Exception e) {
            getLog().warn("Failed to shutdown runner", e);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy