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.plugin.descriptor.PluginDescriptor;
import org.apache.maven.plugins.annotations.Parameter;
import java.io.File;
import java.util.List;
abstract public class ConfigurationMojo extends AbstractMojo {
@Parameter(defaultValue = "${plugin}", required = true, readonly = true)
private PluginDescriptor descriptor;
@Parameter(property = "project.testClasspathElements", required = true, readonly = true)
private List classpathElements;
/**
* 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(" ");
}
protected PluginDescriptor getDescriptor() {
return descriptor;
}
protected List getClasspathElements() {
return classpathElements;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy