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

uk.co.deliverymind.wiremock.maven.plugin.WireMockMojo Maven / Gradle / Ivy

There is a newer version: 2.11.0
Show newest version
package uk.co.deliverymind.wiremock.maven.plugin;

import com.github.tomakehurst.wiremock.standalone.WireMockServerRunner;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;

import java.util.Arrays;

@Mojo(name = "run", defaultPhase = LifecyclePhase.PRE_INTEGRATION_TEST)
public class WireMockMojo extends ConfigurationMojo {

    public void execute() throws MojoExecutionException {
        String wireMockParams = Arrays.toString(getAllParams()).replaceAll("[\\[\\]]", "").replaceAll(", ", " ");
        getLog().info("Starting WireMock with following params: " + wireMockParams);
        WireMockServerRunner.main(getAllParams());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy