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

net.wouterdanes.docker.provider.model.ImageBuildConfiguration Maven / Gradle / Ivy

package net.wouterdanes.docker.provider.model;

import java.io.File;
import java.util.List;

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

/**
 * This class is responsible for holding the configuration of a single docker image to be built by the
 * {@link net.wouterdanes.docker.maven.BuildImageMojo}
 */
public class ImageBuildConfiguration {

    @Parameter(required = true)
    private List files;

    @Parameter(required = true)
    private String id;

    @Parameter
    private String nameAndTag;

    @Parameter(defaultValue = "false")
    private boolean keep;

    public List getFiles() {
        return files;
    }

    public void setFiles(final List files) {
        this.files = files;
    }

    public String getId() {
        return id;
    }

    public void setId(final String id) {
        this.id = id;
    }

    public String getNameAndTag() {
        return nameAndTag;
    }

    public void setNameAndTag(final String nameAndTag) {
        this.nameAndTag = nameAndTag;
    }

    public boolean isKeep() {
        return keep;
    }

    public void setKeep(final boolean keep) {
        this.keep = keep;
    }

    /**
     * Checks if this is a valid configuration, every image build package should have a Dockerfile included.
     * @return true if this configuration can be built, false otherwise.
     */
    public boolean isValid() {
        for (File file : files) {
            if (file.getName().equals("Dockerfile")) {
                return true;
            }
        }
        return false;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy