abstract class AbstractDockerMojo
extends org.apache.maven.plugin.AbstractMojo
| Modifier and Type | Field and Description |
|---|---|
private String |
dockerCertPath |
private String |
dockerHost
URL of the docker host as specified in pom.xml.
|
protected org.apache.maven.plugin.MojoExecution |
execution |
private String |
registryUrl |
private int |
retryPushCount
Number of retries for failing pushes, defaults to 5.
|
private int |
retryPushTimeout
Retry timeout for failing pushes, defaults to 10 seconds.
|
private org.sonatype.plexus.components.sec.dispatcher.SecDispatcher |
secDispatcher
https://issues.apache.org/jira/browse/MNG-4384
|
private String |
serverId |
protected org.apache.maven.execution.MavenSession |
session |
private org.apache.maven.settings.Settings |
settings
The system settings for Maven.
|
private boolean |
skipDocker
Flag to skip docker goal, making goal a no-op.
|
private boolean |
skipDockerPush
Flag to skip docker push, making push goal a no-op.
|
private Boolean |
useConfigFile |
| Constructor and Description |
|---|
AbstractDockerMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected com.spotify.docker.client.messages.AuthConfig |
authConfig()
Builds the AuthConfig object from server details.
|
protected com.spotify.docker.client.DockerClient |
buildDockerClient() |
protected com.google.common.base.Optional<com.spotify.docker.client.DockerCertificates> |
dockerCertificates() |
void |
execute() |
protected abstract void |
execute(com.spotify.docker.client.DockerClient dockerClient) |
protected com.spotify.docker.client.DefaultDockerClient.Builder |
getBuilder() |
private String |
getEmail(org.apache.maven.settings.Server server)
Get the email from the server configuration in
~/.m2/settings.xml. |
int |
getRetryPushCount() |
int |
getRetryPushTimeout() |
private boolean |
incompleteAuthSettings(String username,
String password,
String email)
Checks for incomplete private Docker registry authorization settings.
|
boolean |
isSkipDocker() |
boolean |
isSkipDockerPush() |
protected String |
rawDockerHost() |
@Component(role=org.apache.maven.execution.MavenSession.class) protected org.apache.maven.execution.MavenSession session
@Component(role=org.apache.maven.plugin.MojoExecution.class) protected org.apache.maven.plugin.MojoExecution execution
@Component private org.apache.maven.settings.Settings settings
@Component(role=org.sonatype.plexus.components.sec.dispatcher.SecDispatcher.class,
hint="mng-4384")
private org.sonatype.plexus.components.sec.dispatcher.SecDispatcher secDispatcher
@Parameter(property="dockerHost") private String dockerHost
@Parameter(property="dockerCertPath") private String dockerCertPath
@Parameter(property="serverId") private String serverId
@Parameter(property="registryUrl") private String registryUrl
@Parameter(property="useConfigFile") private Boolean useConfigFile
@Parameter(property="retryPushCount",
defaultValue="5")
private int retryPushCount
@Parameter(property="retryPushTimeout",
defaultValue="10000")
private int retryPushTimeout
@Parameter(property="skipDocker",
defaultValue="false")
private boolean skipDocker
@Parameter(property="skipDockerPush",
defaultValue="false")
private boolean skipDockerPush
public int getRetryPushTimeout()
public int getRetryPushCount()
public boolean isSkipDocker()
public boolean isSkipDockerPush()
public void execute()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected com.spotify.docker.client.DefaultDockerClient.Builder getBuilder()
throws com.spotify.docker.client.exceptions.DockerCertificateException
com.spotify.docker.client.exceptions.DockerCertificateExceptionprotected com.spotify.docker.client.DockerClient buildDockerClient()
throws com.spotify.docker.client.exceptions.DockerCertificateException,
org.sonatype.plexus.components.sec.dispatcher.SecDispatcherException,
org.apache.maven.plugin.MojoExecutionException
com.spotify.docker.client.exceptions.DockerCertificateExceptionorg.sonatype.plexus.components.sec.dispatcher.SecDispatcherExceptionorg.apache.maven.plugin.MojoExecutionExceptionprotected abstract void execute(com.spotify.docker.client.DockerClient dockerClient)
throws Exception
Exceptionprotected String rawDockerHost()
protected com.google.common.base.Optional<com.spotify.docker.client.DockerCertificates> dockerCertificates()
throws com.spotify.docker.client.exceptions.DockerCertificateException
com.spotify.docker.client.exceptions.DockerCertificateExceptionprivate String getEmail(org.apache.maven.settings.Server server)
~/.m2/settings.xml.
The abovemy-private-docker-registry [...]foo@bar.com
settings.xml would return "foo@bar.com".server - Serverprivate boolean incompleteAuthSettings(String username, String password, String email)
username - Auth username.password - Auth password.email - Auth email.protected com.spotify.docker.client.messages.AuthConfig authConfig()
throws org.apache.maven.plugin.MojoExecutionException,
org.sonatype.plexus.components.sec.dispatcher.SecDispatcherException
org.apache.maven.plugin.MojoExecutionExceptionorg.sonatype.plexus.components.sec.dispatcher.SecDispatcherExceptionCopyright © 2016. All rights reserved.