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

tools.bestquality.maven.ci.CiPomMojo Maven / Gradle / Ivy

There is a newer version: 0.0.20
Show newest version
package tools.bestquality.maven.ci;

import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugins.annotations.Parameter;

import java.io.File;
import java.nio.file.Path;

public abstract class CiPomMojo>
        extends AbstractMojo {

    @Parameter(defaultValue = "${project.build.directory}/generated-poms")
    private File outputDirectory;

    @Parameter(defaultValue = "pom-ci.xml")
    private String ciPomFilename;


    public File getOutputDirectory() {
        return outputDirectory;
    }

    @SuppressWarnings("unchecked")
    public M withOutputDirectory(File outputDirectory) {
        this.outputDirectory = outputDirectory;
        return (M) this;
    }

    public String getCiPomFilename() {
        return ciPomFilename;
    }

    @SuppressWarnings("unchecked")
    public M withCiPomFilename(String ciPomFilename) {
        this.ciPomFilename = ciPomFilename;
        return (M) this;
    }

    protected void info(CharSequence message) {
        getLog().info(message);
    }

    protected void error(CharSequence message, Throwable error) {
        getLog().error(message, error);
    }

    protected void warn(CharSequence message) {
        getLog().warn(message);
    }

    protected Path ciPomPath() {
        return outputDirectory.toPath()
                .resolve(ciPomFilename);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy