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

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

There is a newer version: 2.11.0
Show newest version
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;

    /**
     * Set to true if (and only if) you want to keep the plugin running indefinitely.
     */
    @Parameter(property = "keepRunning", defaultValue = "false")
    private String keepRunning;

    boolean shouldKeepRunning() {
        return keepRunning.equals("true");
    }

    String[] getAllParams() {
        return Parameters.getAllParams(dir.toString(), params);
    }

    PluginDescriptor getDescriptor() {
        return descriptor;
    }

    List getClasspathElements() {
        return classpathElements;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy