org.mockserver.maven.MockServerStopForkedMojo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mockserver-maven-plugin Show documentation
Show all versions of mockserver-maven-plugin Show documentation
A maven plugin to start and stop the MockServer
package org.mockserver.maven;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.mockserver.server.EmbeddedJettyRunner;
/**
* Stop the a forked instance of the MockServer
*
* @author jamesdbloom
*/
@Mojo(name = "stopForked", requiresProject = false, threadSafe = false)
public class MockServerStopForkedMojo extends AbstractMojo {
/**
* Logging level
*/
@Parameter(property = "mockserver.logLevel", defaultValue = "WARN")
private String logLevel;
/**
* The port to stop MockServer
*/
@Parameter(property = "mockserver.stopPort", defaultValue = "8081")
private int stopPort;
/**
* Key to provide when stopping MockServer
*/
@Parameter(property = "mockserver.stopKey", defaultValue = "STOP_KEY")
protected String stopKey;
/**
* Max time in seconds to wait for the MockServer to stop
*/
@Parameter(property = "mockserver.stopWait")
protected int stopWait;
public void execute() throws MojoExecutionException {
EmbeddedJettyRunner.overrideLogLevel(logLevel);
EmbeddedJettyRunner.stopRemote("127.0.0.1", stopPort, stopKey, stopWait);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy