Class AbstractDockerMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.technologybrewery.orphedomos.mojo.AbstractDockerMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
DockerBuildMojo,DockerBuildMultiPlatformMojo,DockerDeployMojo,VerifyDockerEnvironmentMojo
public abstract class AbstractDockerMojo extends org.apache.maven.plugin.AbstractMojo
-
-
Field Summary
Fields Modifier and Type Field Description protected String[]aliasesprotected Map<String,String>buildArgsprotected FiledockerContextprotected StringdockerfilePathprotected booleandryRunprotected StringimageNameprotected StringimageVersionprotected StringrepoIdprotected StringrepoUrlprotected org.apache.maven.settings.Settingssettingsprotected String[]targetArchitecturesprotected booleanuseBuildKitprotected booleanusePlainTextPassword
-
Constructor Summary
Constructors Constructor Description AbstractDockerMojo()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voiddoExecute()Encapsulates all build logic associated with this plugin goal -execute()delegates to this method after performing execution handling that is common across all Mojos.voidexecute()protected StringfindPasswordForServer(String serverId)protected List<String>getArgumentsList()protected StringgetDockerfilePath()protected StringgetImageTag()protected StringgetImageTagWithArch(String arch)protected booleanisOrphedomosModule()protected voidlogin()protected voidlogout()protected StringprependRegistry(String suffix)
-
-
-
Field Detail
-
dockerContext
@Parameter(defaultValue="${project.basedir}", property="orphedomos.docker.context") protected File dockerContext
-
dryRun
@Parameter(defaultValue="false", property="orphedomos.build.dryrun") protected boolean dryRun
-
settings
@Parameter(defaultValue="${settings}", readonly=true, required=true) protected org.apache.maven.settings.Settings settings
-
imageName
@Parameter(defaultValue="${project.artifactId}", property="orphedomos.image.name") protected String imageName
-
imageVersion
@Parameter(defaultValue="${project.version}", property="orphedomos.image.version") protected String imageVersion
-
aliases
@Parameter(property="orphedomos.image.aliases") protected String[] aliases
-
usePlainTextPassword
@Parameter(defaultValue="false", property="orphedomos.credential.usePlainTextPassword") protected boolean usePlainTextPassword
-
repoId
@Parameter(defaultValue="", property="orphedomos.repository.id") protected String repoId
-
repoUrl
@Parameter(defaultValue="", property="orphedomos.repository.url") protected String repoUrl
-
useBuildKit
@Parameter(defaultValue="true", property="orphedomos.buildkit.enable") protected boolean useBuildKit
-
dockerfilePath
@Parameter(defaultValue="/src/main/resources/docker/Dockerfile", property="orphedomos.dockerfile.path") protected String dockerfilePath
-
targetArchitectures
@Parameter(property="orphedomos.build.architecture") protected String[] targetArchitectures
-
-
Method Detail
-
getImageTag
protected String getImageTag()
-
isOrphedomosModule
protected boolean isOrphedomosModule()
-
getDockerfilePath
protected String getDockerfilePath()
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
doExecute
protected abstract void doExecute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureExceptionEncapsulates all build logic associated with this plugin goal -execute()delegates to this method after performing execution handling that is common across all Mojos.- Throws:
org.apache.maven.plugin.MojoExecutionException- a mojo exceptionorg.apache.maven.plugin.MojoFailureException- a mojo failure
-
login
protected void login() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
logout
protected void logout() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
-