uk.co.deliverymind.wiremock.maven.plugin.ConfigurationMojo Maven / Gradle / Ivy
package uk.co.deliverymind.wiremock.maven.plugin;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugins.annotations.Parameter;
import java.io.File;
abstract public class ConfigurationMojo extends AbstractMojo {
/**
* Set the root directory (--root-dir), under which mappings and __files reside.
* This defaults to: target/classes
*/
@Parameter(property = "dir", defaultValue = "target/classes")
private File dir;
/**
* Set all other parameters in command-line format, e.g.:
* --port=8081 --verbose
* Do NOT specify --root-dir here.
*/
@Parameter(property = "params")
private String params;
protected String[] getAllParams() {
String allParams = String.format("%s%s %s", "--root-dir=", dir, params);
return allParams.split(" ");
}
}