public abstract class AbstractDockerMojo extends org.apache.maven.plugin.AbstractMojo implements org.eclipse.jkube.kit.build.service.docker.helper.ConfigHelper.Customizer, org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable, KitLoggerProvider
| Modifier and Type | Field and Description |
|---|---|
protected org.eclipse.jkube.kit.config.access.ClusterConfiguration |
access |
protected String |
apiVersion |
protected org.eclipse.jkube.kit.config.image.build.RegistryAuthConfiguration |
authConfig |
protected org.eclipse.jkube.kit.build.service.docker.auth.AuthConfigFactory |
authConfigFactory |
protected boolean |
autoCreateCustomNetworks
Whether to create the customs networks (user-defined bridge networks) before starting automatically
|
protected String |
autoPull |
protected Map<String,String> |
buildArgs |
protected String |
buildRecreate
How to recreate the build config and/or image stream created by the build.
|
protected org.eclipse.jkube.kit.config.image.build.JKubeBuildStrategy |
buildStrategy
Build mode when build is performed.
|
protected String |
certPath |
protected org.eclipse.jkube.kit.config.access.ClusterAccess |
clusterAccess |
protected String |
containerNamePattern
Naming pattern for how to name containers when started
|
static String |
CONTEXT_KEY_BUILD_TIMESTAMP |
static String |
CONTEXT_KEY_LOG_DISPATCHER |
static String |
DMP_PLUGIN_DESCRIPTOR |
static String |
DOCKER_BUILD_TIMESTAMP |
static String |
DOCKER_EXTRA_DIR |
protected org.eclipse.jkube.kit.build.service.docker.DockerAccessFactory |
dockerAccessFactory |
protected String |
dockerHost
URL to docker daemon
|
protected org.eclipse.jkube.kit.config.resource.ProcessorConfig |
enricher
Enrichers used for enricher build objects
|
protected String |
environment
Environment name where resources are placed.
|
protected String |
filter
Whether to restrict operation to a single image.
|
protected boolean |
forcePull
While creating a BuildConfig, By default, if the builder image specified in the
build configuration is available locally on the node, that image will be used.
|
protected org.eclipse.jkube.kit.config.resource.ProcessorConfig |
generator
Generator specific options.
|
protected org.eclipse.jkube.kit.build.service.docker.config.handler.ImageConfigResolver |
imageConfigResolver |
protected String |
imagePullPolicy |
protected List<org.eclipse.jkube.kit.config.image.ImageConfiguration> |
images
Image configurations configured directly.
|
protected org.eclipse.jkube.kit.common.JavaProject |
javaProject |
protected JKubeServiceHub |
jkubeServiceHub |
protected boolean |
keepContainer |
protected boolean |
keepRunning |
protected org.eclipse.jkube.kit.common.KitLogger |
log |
protected String |
logDate |
protected org.eclipse.jkube.kit.build.service.docker.access.log.LogOutputSpecFactory |
logOutputSpecFactory |
protected boolean |
logStdout |
protected org.eclipse.jkube.kit.build.service.docker.config.DockerMachineConfiguration |
machine |
protected int |
maxConnections |
protected String |
minimalApiVersion |
protected org.apache.maven.plugin.MojoExecution |
mojoExecution |
protected String |
namespace
Namespace to use when accessing Kubernetes or OpenShift
|
protected boolean |
offline |
protected String |
outputDirectory |
protected org.codehaus.plexus.PlexusContainer |
plexusContainer |
protected String |
profile
Profile to use.
|
protected org.apache.maven.project.MavenProject |
project |
protected org.apache.maven.project.MavenProjectHelper |
projectHelper |
protected String |
pullRegistry |
protected String |
registry |
protected boolean |
removeVolumes |
protected List<org.eclipse.jkube.kit.config.image.ImageConfiguration> |
resolvedImages |
protected File |
resourceDir
Folder where to find project specific files, e.g a custom profile
|
protected org.eclipse.jkube.kit.config.resource.ResourceConfig |
resources
Resource config for getting annotation and labels to be applied to enriched build objects
|
protected org.eclipse.jkube.kit.config.resource.RuntimeMode |
runtimeMode |
protected org.apache.maven.execution.MavenSession |
session |
protected org.apache.maven.settings.Settings |
settings |
protected boolean |
skip |
protected boolean |
skipBuild |
protected Boolean |
skipBuildPom |
protected boolean |
skipExtendedAuth
Skip extended authentication
|
protected boolean |
skipMachine
Whether the usage of docker machine should be skipped completely
|
protected String |
sourceDirectory |
protected boolean |
useColor |
protected boolean |
useProjectClasspath
Should we use the project's compile-time classpath to scan for additional enrichers/generators?
|
protected String |
verbose |
protected boolean |
watchFollow |
protected int |
watchInterval |
protected org.eclipse.jkube.kit.config.image.WatchMode |
watchMode
Watching mode for rebuilding images
|
protected String |
watchPostExec |
protected String |
watchPostGoal |
protected String |
watchShowLogs |
| Constructor and Description |
|---|
AbstractDockerMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected BuildServiceConfig.BuildServiceConfigBuilder |
buildServiceConfigBuilder() |
protected void |
callBuildPlugin(File outputDir,
String buildPluginClass) |
protected boolean |
canExecute() |
void |
contextualize(org.codehaus.plexus.context.Context context) |
List<org.eclipse.jkube.kit.config.image.ImageConfiguration> |
customizeConfig(List<org.eclipse.jkube.kit.config.image.ImageConfiguration> configs)
Customization hook called by the base plugin.
|
protected void |
doExecute() |
void |
execute() |
protected void |
executeBuildPlugins() |
protected abstract void |
executeInternal()
Hook for subclass for doing the real job
|
protected org.eclipse.jkube.kit.config.resource.ProcessorConfig |
extractEnricherConfig() |
protected org.eclipse.jkube.kit.config.resource.ProcessorConfig |
extractGeneratorConfig() |
protected org.eclipse.jkube.generator.api.GeneratorContext.GeneratorContextBuilder |
generatorContextBuilder() |
protected File |
getAndEnsureOutputDirectory() |
org.eclipse.jkube.kit.config.resource.RuntimeMode |
getConfiguredRuntimeMode() |
protected org.eclipse.jkube.kit.build.service.docker.DockerAccessFactory.DockerAccessContext |
getDockerAccessContext() |
org.eclipse.jkube.kit.enricher.api.EnricherContext |
getEnricherContext() |
protected org.eclipse.jkube.kit.build.core.GavLabel |
getGavLabel() |
protected org.eclipse.jkube.kit.config.image.build.JKubeBuildStrategy |
getJKubeBuildStrategy() |
org.eclipse.jkube.kit.common.KitLogger |
getKitLogger() |
protected org.eclipse.jkube.kit.build.service.docker.access.log.LogDispatcher |
getLogDispatcher(org.eclipse.jkube.kit.build.service.docker.DockerServiceHub hub) |
protected String |
getLogPrefix() |
protected org.eclipse.jkube.kit.common.RegistryConfig |
getRegistryConfig(String specificRegistry) |
protected List<org.eclipse.jkube.kit.config.image.ImageConfiguration> |
getResolvedImages()
Get all images to use.
|
protected void |
init() |
protected org.eclipse.jkube.kit.config.access.ClusterConfiguration |
initClusterConfiguration() |
protected org.eclipse.jkube.kit.common.JKubeConfiguration |
initJKubeConfiguration() |
protected boolean |
isDockerAccessRequired() |
protected void |
logException(Exception exp) |
protected void |
processDmpPluginDescription(URL pluginDesc,
File outputDir) |
protected boolean |
shouldSkipBecauseOfPomPackaging() |
protected boolean |
useColorForLogging()
Determine whether to enable colorized log messages
|
public static final String DMP_PLUGIN_DESCRIPTOR
public static final String DOCKER_EXTRA_DIR
public static final String CONTEXT_KEY_LOG_DISPATCHER
public static final String CONTEXT_KEY_BUILD_TIMESTAMP
public static final String DOCKER_BUILD_TIMESTAMP
@Parameter protected org.eclipse.jkube.kit.config.access.ClusterConfiguration access
@Parameter(defaultValue="${project}",
readonly=true)
protected org.apache.maven.project.MavenProject project
@Parameter(defaultValue="${session}",
readonly=true)
protected org.apache.maven.execution.MavenSession session
@Parameter(defaultValue="${mojoExecution}",
readonly=true)
protected org.apache.maven.plugin.MojoExecution mojoExecution
@Parameter(property="jkube.docker.apiVersion") protected String apiVersion
@Parameter(property="jkube.docker.verbose",
defaultValue="false")
protected String verbose
@Parameter(property="jkube.docker.logDate") protected String logDate
@Parameter(property="jkube.docker.logStdout",
defaultValue="false")
protected boolean logStdout
@Parameter(property="jkube.docker.host") protected String dockerHost
@Parameter(property="jkube.docker.certPath") protected String certPath
@Parameter protected org.eclipse.jkube.kit.build.service.docker.config.DockerMachineConfiguration machine
@Parameter(property="jkube.docker.skip.machine",
defaultValue="false")
protected boolean skipMachine
@Parameter(property="jkube.docker.maxConnections",
defaultValue="100")
protected int maxConnections
@Parameter(property="jkube.useColor",
defaultValue="true")
protected boolean useColor
@Parameter(property="jkube.image.filter") protected String filter
protected List<org.eclipse.jkube.kit.config.image.ImageConfiguration> resolvedImages
@Parameter(defaultValue="${settings}",
readonly=true)
protected org.apache.maven.settings.Settings settings
@Parameter(property="jkube.build.source.dir",
defaultValue="src/main/docker")
protected String sourceDirectory
@Parameter(property="jkube.build.target.dir",
defaultValue="target/docker")
protected String outputDirectory
@Parameter(property="jkube.docker.autoPull") protected String autoPull
@Parameter(property="jkube.docker.imagePullPolicy") protected String imagePullPolicy
@Parameter(property="jkube.docker.pull.registry") protected String pullRegistry
@Parameter(property="jkube.build.strategy") protected org.eclipse.jkube.kit.config.image.build.JKubeBuildStrategy buildStrategy
@Parameter(property="jkube.profile") protected String profile
However, any given enricher and or generator configuration overrides the information provided by a profile.
@Component protected org.eclipse.jkube.kit.build.service.docker.config.handler.ImageConfigResolver imageConfigResolver
@Parameter(property="jkube.docker.skip.extendedAuth",
defaultValue="false")
protected boolean skipExtendedAuth
@Parameter protected org.eclipse.jkube.kit.config.image.build.RegistryAuthConfiguration authConfig
@Parameter(property="jkube.docker.registry") protected String registry
@Parameter(property="jkube.build.recreate",
defaultValue="none")
protected String buildRecreate
mode == openshift or mode is auto
and openshift is detected. If not set, existing
build config will not be recreated.
The possible values are:
@Component protected org.apache.maven.project.MavenProjectHelper projectHelper
@Component protected org.eclipse.jkube.kit.build.service.docker.DockerAccessFactory dockerAccessFactory
@Parameter protected List<org.eclipse.jkube.kit.config.image.ImageConfiguration> images
@Parameter(property="jkube.skip.build",
defaultValue="false")
protected boolean skipBuild
@Parameter(property="jkube.skip",
defaultValue="false")
protected boolean skip
@Parameter(property="jkube.skip.build.pom") protected Boolean skipBuildPom
@Parameter protected org.eclipse.jkube.kit.config.resource.ProcessorConfig generator
<generator-prefix>-<option>.@Parameter(property="jkube.build.forcePull",
defaultValue="false")
protected boolean forcePull
ForcePull to override the local image and refresh it from the registry to which the image stream points.
@Parameter(property="jkube.useProjectClasspath",
defaultValue="false")
protected boolean useProjectClasspath
@Parameter protected org.eclipse.jkube.kit.config.resource.ResourceConfig resources
@Parameter protected org.eclipse.jkube.kit.config.resource.ProcessorConfig enricher
@Parameter(property="jkube.resourceDir",
defaultValue="${basedir}/src/main/jkube")
protected File resourceDir
@Parameter(property="jkube.environment") protected String environment
protected org.eclipse.jkube.kit.build.service.docker.auth.AuthConfigFactory authConfigFactory
protected org.eclipse.jkube.kit.common.KitLogger log
protected org.eclipse.jkube.kit.build.service.docker.access.log.LogOutputSpecFactory logOutputSpecFactory
protected String minimalApiVersion
protected org.eclipse.jkube.kit.config.access.ClusterAccess clusterAccess
protected JKubeServiceHub jkubeServiceHub
protected org.eclipse.jkube.kit.config.resource.RuntimeMode runtimeMode
protected org.codehaus.plexus.PlexusContainer plexusContainer
@Parameter(property="jkube.watch.mode",
defaultValue="both")
protected org.eclipse.jkube.kit.config.image.WatchMode watchMode
@Parameter(property="jkube.watch.interval",
defaultValue="5000")
protected int watchInterval
@Parameter(property="jkube.watch.keepRunning",
defaultValue="false")
protected boolean keepRunning
@Parameter(property="jkube.watch.postGoal") protected String watchPostGoal
@Parameter(property="jkube.watch.postExec") protected String watchPostExec
@Parameter(property="jkube.watch.keepContainer",
defaultValue="false")
protected boolean keepContainer
@Parameter(property="jkube.watch.removeVolumes",
defaultValue="false")
protected boolean removeVolumes
@Parameter(property="jkube.watch.follow",
defaultValue="false")
protected boolean watchFollow
@Parameter(property="jkube.watch.showLogs") protected String watchShowLogs
@Parameter(property="jkube.watch.containerNamePattern") protected String containerNamePattern
@Parameter(property="jkube.namespace") protected String namespace
@Parameter(property="jkube.watch.autoCreateCustomNetworks",
defaultValue="false")
protected boolean autoCreateCustomNetworks
@Parameter(property="jkube.offline",
defaultValue="false")
protected boolean offline
protected org.eclipse.jkube.kit.common.JavaProject javaProject
public void contextualize(org.codehaus.plexus.context.Context context)
throws org.codehaus.plexus.context.ContextException
contextualize in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizableorg.codehaus.plexus.context.ContextExceptionpublic org.eclipse.jkube.kit.common.KitLogger getKitLogger()
getKitLogger in interface KitLoggerProviderpublic org.eclipse.jkube.kit.config.resource.RuntimeMode getConfiguredRuntimeMode()
public final void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
execute in interface org.apache.maven.plugin.Mojoorg.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionprotected void init()
protected boolean canExecute()
protected void doExecute()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected abstract void executeInternal()
throws IOException,
org.apache.maven.plugin.MojoExecutionException
IOExceptionorg.apache.maven.plugin.MojoExecutionExceptionprotected org.eclipse.jkube.kit.common.JKubeConfiguration initJKubeConfiguration()
throws org.apache.maven.artifact.DependencyResolutionRequiredException
org.apache.maven.artifact.DependencyResolutionRequiredExceptionprotected File getAndEnsureOutputDirectory()
protected void processDmpPluginDescription(URL pluginDesc, File outputDir) throws IOException
IOExceptionprotected org.eclipse.jkube.kit.common.RegistryConfig getRegistryConfig(String specificRegistry)
protected void callBuildPlugin(File outputDir, String buildPluginClass) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException
protected void logException(Exception exp)
protected org.eclipse.jkube.kit.build.service.docker.DockerAccessFactory.DockerAccessContext getDockerAccessContext()
protected List<org.eclipse.jkube.kit.config.image.ImageConfiguration> getResolvedImages()
protected boolean isDockerAccessRequired()
protected boolean shouldSkipBecauseOfPomPackaging()
protected BuildServiceConfig.BuildServiceConfigBuilder buildServiceConfigBuilder()
public List<org.eclipse.jkube.kit.config.image.ImageConfiguration> customizeConfig(List<org.eclipse.jkube.kit.config.image.ImageConfiguration> configs)
customizeConfig in interface org.eclipse.jkube.kit.build.service.docker.helper.ConfigHelper.Customizerconfigs - configuration to customizeprotected String getLogPrefix()
protected org.eclipse.jkube.kit.config.image.build.JKubeBuildStrategy getJKubeBuildStrategy()
public org.eclipse.jkube.kit.enricher.api.EnricherContext getEnricherContext()
throws org.apache.maven.artifact.DependencyResolutionRequiredException
org.apache.maven.artifact.DependencyResolutionRequiredExceptionprotected org.eclipse.jkube.generator.api.GeneratorContext.GeneratorContextBuilder generatorContextBuilder()
throws org.apache.maven.artifact.DependencyResolutionRequiredException
org.apache.maven.artifact.DependencyResolutionRequiredExceptionprotected org.eclipse.jkube.kit.config.resource.ProcessorConfig extractGeneratorConfig()
protected org.eclipse.jkube.kit.config.resource.ProcessorConfig extractEnricherConfig()
protected void executeBuildPlugins()
protected boolean useColorForLogging()
protected org.eclipse.jkube.kit.config.access.ClusterConfiguration initClusterConfiguration()
protected org.eclipse.jkube.kit.build.core.GavLabel getGavLabel()
protected org.eclipse.jkube.kit.build.service.docker.access.log.LogDispatcher getLogDispatcher(org.eclipse.jkube.kit.build.service.docker.DockerServiceHub hub)
Copyright © 2022. All rights reserved.