Class AbstractOsgiDockerMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- br.com.c8tech.tools.maven.osgi.lib.mojo.AbstractCustomPackagingMojo
-
- br.com.c8tech.tools.maven.plugin.osgi.container.AbstractOsgiContainerPackMojo
-
- br.com.c8tech.tools.maven.plugin.osgi.container.AbstractOsgiDockerMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
MojoBuildDocker,MojoPushDocker,MojoTagDocker
public abstract class AbstractOsgiDockerMojo extends AbstractOsgiContainerPackMojo
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractOsgiDockerMojo.Metadata
-
Field Summary
Fields Modifier and Type Field Description protected booleanbuildDockerAllows the generation of a docker image.protected longconnectTimeoutMillisprotected StringdockerClassifierClassifier to use when attaching the Docker info JAR.protected FiledockerConfigFilePath to docker config file, if the default is not acceptable.protected FiledockerInfoDirectoryDirectory where various Docker-related metadata fragments will be stored.protected Stringpasswordprotected longreadTimeoutMillisprotected intretryCountCertain Docker operations can fail due to mysterious Docker daemon conditions.protected FiletestOutputDirectoryDirectory where test metadata will be written during build.protected booleanuseMavenSettingsForAuthA maven server id, in order to use maven settings to supply server auth.protected booleanuseProxyWhether to connect to Docker Daemon using HTTP proxy, if set.protected Stringusername-
Fields inherited from class br.com.c8tech.tools.maven.plugin.osgi.container.AbstractOsgiContainerPackMojo
DOWNLOAD_STATUS, EQUINOX_CONFIGURATION_NAME, EQUINOX_CONFIGURATION_PATH, FELIX_CONFIGURATION_NAME, FELIX_CONFIGURATION_PATH, PROPERTY_CACHE_DIR, PROPERTY_WORK_DIR
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractOsgiDockerMojo(org.apache.maven.project.MavenProject pProject)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected FilebuildDockerInfoJar(org.apache.maven.plugin.logging.Log log)protected FileensureDockerInfoDirectory()protected FileensureMetadataFile(AbstractOsgiDockerMojo.Metadata metadata)protected abstract voidexecute(com.spotify.docker.client.DockerClient dockerClient)voidexecuteMojo()protected static StringformatImageName(String repository, String tag)protected StringreadMetadata(AbstractOsgiDockerMojo.Metadata metadata)protected voidwriteImageInfo(String repository, String tag)protected voidwriteMetadata(AbstractOsgiDockerMojo.Metadata metadata, String value)protected voidwriteMetadata(org.apache.maven.plugin.logging.Log log)-
Methods inherited from class br.com.c8tech.tools.maven.plugin.osgi.container.AbstractOsgiContainerPackMojo
addMavenArtifactSet, addScope, calculateContainerConfigurationFileOutputPath, createDefaultDirectories, doBeforeSkipMojo, executeExtraInitializationSteps, getBaseContainerConfigurationFileUrl, getBundleValidArtifactFilter, getCacheDirectory, getConfiguratorInitialFile, getContainer, getContainerCacheDirectory, getContainerPomDependenciesGAV, getContainerWorkDirectory, getDefaultSupportedPackagings, getEncoding, getExcludedArtifacts, getLocalRepositoryGAV, getLogbackConfigurationFile, getMavenArtifactSets, getMsgChoiceArtifact, getProjectBuilder, getScopes, isOptionalConsidered, isRunOnlyAtExecutionRoot, isSkip, isSkipConfigurationGen, isTransitiveConsidered, loadProperties, setBaseContainerConfigurationFileUrl, setConfiguratorInitialFile, setContainerPomDependenciesGAV, setEncoding, setLocalRepositoryGAV, setLogbackConfigurationFile, setScopes, setSkipConfigurationGen
-
Methods inherited from class br.com.c8tech.tools.maven.osgi.lib.mojo.AbstractCustomPackagingMojo
addExtraSupportedPackaging, cleanWorkDirectory, combineScopes, copyInternalFileToProjectDir, copyInternalFileToProjectDir, doInitialValidation, execute, getBasedir, getBuildDir, getCachedFileNamePattern, getCacheSubDirectory, getClassifier, getDependenciesHelper, getDirectoryHelper, getExtraSupportedPackagings, getFilterFactory, getFinalName, getGoalName, getLocalRepository, getMavenSession, getPluginDescriptor, getProject, getProjectHelper, getRemoteRepositories, getRepositorySystem, getRuntimeInformation, getSupportedPackagings, getWorkDirectory, getWorkSubDirectory, isAggregator, isVerbose, loadProject, loadProject, registerArtifactsIntoAggregatorBuildContext, setBuildDir, setClassifier, setExtraSupportedPackagings, setFinalName, setWorkDirectory
-
-
-
-
Field Detail
-
buildDocker
@Parameter(defaultValue="false") protected boolean buildDocker
Allows the generation of a docker image.
-
dockerClassifier
@Parameter(defaultValue="docker-info", property="dockerfile.classifier") protected String dockerClassifierClassifier to use when attaching the Docker info JAR. If empty or absent, the JAR will become the main artifact of the project.
-
connectTimeoutMillis
@Parameter(defaultValue="300000", property="dockerfile.connectTimeoutMillis", required=true) protected long connectTimeoutMillis
-
dockerConfigFile
@Parameter(property="dockerfile.dockerConfigFile") protected File dockerConfigFile
Path to docker config file, if the default is not acceptable.
-
dockerInfoDirectory
@Parameter(defaultValue="${project.build.directory}/docker", property="dockerfile.dockerInfoDirectory", required=true) protected File dockerInfoDirectoryDirectory where various Docker-related metadata fragments will be stored.
-
password
@Parameter(property="dockerfile.password") protected String password
-
readTimeoutMillis
@Parameter(defaultValue="300000", property="dockerfile.readTimeoutMillis", required=true) protected long readTimeoutMillis
-
retryCount
@Parameter(defaultValue="1", property="dockerfile.retryCount") protected int retryCountCertain Docker operations can fail due to mysterious Docker daemon conditions. Sometimes it might be worth it to just retry operations until they succeed. This parameter controls how many times operations should be retried before they fail. By default, an extra attempt (so up to two attempts) is made before failing.
-
testOutputDirectory
@Parameter(defaultValue="${project.build.testOutputDirectory}", property="dockerfile.testOutputDirectory", required=true) protected File testOutputDirectoryDirectory where test metadata will be written during build.
-
useMavenSettingsForAuth
@Parameter(defaultValue="false", property="dockerfile.useMavenSettingsForAuth") protected boolean useMavenSettingsForAuthA maven server id, in order to use maven settings to supply server auth.
-
useProxy
@Parameter(defaultValue="true", property="dockerfile.useProxy") protected boolean useProxyWhether to connect to Docker Daemon using HTTP proxy, if set.
-
username
@Parameter(property="dockerfile.username") protected String username
-
-
Method Detail
-
formatImageName
@Nonnull protected static String formatImageName(@Nonnull String repository, @Nonnull String tag)
-
buildDockerInfoJar
@Nonnull protected File buildDockerInfoJar(@Nonnull org.apache.maven.plugin.logging.Log log) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
ensureDockerInfoDirectory
@Nonnull protected File ensureDockerInfoDirectory() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
ensureMetadataFile
@Nonnull protected File ensureMetadataFile(@Nonnull AbstractOsgiDockerMojo.Metadata metadata) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
execute
protected abstract void execute(com.spotify.docker.client.DockerClient dockerClient) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
executeMojo
public void executeMojo() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Overrides:
executeMojoin classbr.com.c8tech.tools.maven.osgi.lib.mojo.AbstractCustomPackagingMojo- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
readMetadata
@Nullable protected String readMetadata(@Nonnull AbstractOsgiDockerMojo.Metadata metadata) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
writeImageInfo
protected void writeImageInfo(String repository, String tag) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
writeMetadata
protected void writeMetadata(org.apache.maven.plugin.logging.Log log) throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
writeMetadata
protected void writeMetadata(@Nonnull AbstractOsgiDockerMojo.Metadata metadata, @Nonnull String value) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
-