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

com.alexecollins.docker.mojo.CopyMojo Maven / Gradle / Ivy

There is a newer version: 2.11.24
Show newest version
package com.alexecollins.docker.mojo;

import com.alexecollins.docker.orchestration.DockerOrchestrator;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;

/**
 * Copy resources from the containers.
 */
@Mojo(name = "copy", defaultPhase = LifecyclePhase.PACKAGE)
public class CopyMojo extends AbstractDockerMojo {
    /**
     * Resource to copy out of the docker container.
     */
    @Parameter(property = "docker.source")
    private String resource;

    /**
     * Resource to copy out of the docker container.
     */
    @Parameter(property = "docker.dest")
    private String dest;

    public String getSource() {
        return resource;
    }

    public String getDest() {
        return dest;
    }

    @Override
    protected void doExecute(DockerOrchestrator orchestrator) throws Exception {
        getLog().info("Copying " + getSource() + " to " + getDest());
        orchestrator.copy(getSource(), getDest());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy