public abstract class AbstractDockerMojo
extends org.apache.maven.plugin.AbstractMojo
Modifier and Type | Field and Description |
---|---|
protected List<String> |
appArguments
List of additional arguments that will be passed to the application.
|
protected ApplicationConfigurationService |
applicationConfigurationService |
static String |
ARM_ARCH |
protected String |
baseImageRun
The Docker image used to run the native image.
|
static String |
DEFAULT_BASE_IMAGE_GRAALVM_RUN |
protected DockerService |
dockerService |
protected JibConfigurationService |
jibConfigurationService |
static String |
LATEST_TAG |
protected String |
mainClass
The main class of the application, as defined in the
Exec Maven Plugin.
|
protected org.apache.maven.project.MavenProject |
mavenProject |
protected String |
micronautRuntime
The target runtime of the application.
|
static String |
MOSTLY_STATIC_NATIVE_IMAGE_GRAALVM_FLAG |
protected List<String> |
nativeImageBuildArgs
Additional arguments that will be passed to the
native-image executable. |
protected Boolean |
staticNativeImage
Whether to produce a static native image when using
docker-native packaging. |
static String |
X86_64_ARCH |
Modifier | Constructor and Description |
---|---|
protected |
AbstractDockerMojo(org.apache.maven.project.MavenProject mavenProject,
JibConfigurationService jibConfigurationService,
ApplicationConfigurationService applicationConfigurationService,
DockerService dockerService) |
Modifier and Type | Method and Description |
---|---|
protected void |
copyDependencies()
Copy project dependencies to a
target/dependency directory. |
protected String |
getCmd()
Returns the Docker CMD command.
|
protected String |
getFrom()
Determines the base FROM image for the native image.
|
protected Optional<String> |
getFromImage()
Returns the base image from the jib configuration (if any).
|
protected String |
getGraalVmBuildArgs()
Returns any additional GraalVM arguments.
|
protected String |
getPort()
Determines the application port to expose by looking at the application configuration.
|
protected Set<String> |
getTags()
Calculates the Docker image tags by looking at the Jib plugin configuration.
|
protected String |
graalVmArch()
Detects the OS architecture to use for GraalVM depending on the
os.arch system property. |
protected String |
graalVmJvmVersion()
Calculates the JVM version to use for GraalVM.
|
protected String |
graalVmVersion()
Returns the GraalVM version from the
graalvm.version property, which is expected to come from the
Micronaut Parent POM. |
protected org.apache.maven.artifact.versioning.ArtifactVersion |
javaVersion()
Returns the Java version from either the
maven.compiler.target property or the java.version property. |
getLog, getPluginContext, setLog, setPluginContext
public static final String LATEST_TAG
public static final String DEFAULT_BASE_IMAGE_GRAALVM_RUN
public static final String MOSTLY_STATIC_NATIVE_IMAGE_GRAALVM_FLAG
public static final String ARM_ARCH
public static final String X86_64_ARCH
protected final org.apache.maven.project.MavenProject mavenProject
protected final JibConfigurationService jibConfigurationService
protected final ApplicationConfigurationService applicationConfigurationService
protected final DockerService dockerService
@Parameter(property="micronaut.native-image.args") protected List<String> nativeImageBuildArgs
native-image
executable. Note that this will only
be used when using a packaging of type docker-native
. For native-image
packaging
you should use the
Native Image Maven Plugin
configuration options.@Parameter(property="mn.appArgs") protected List<String> appArguments
@Parameter(defaultValue="${exec.mainClass}", required=true) protected String mainClass
@Parameter(defaultValue="false", property="micronaut.native-image.static") protected Boolean staticNativeImage
docker-native
packaging.@Parameter(property="micronaut.runtime", defaultValue="NONE") protected String micronautRuntime
@Parameter(property="micronaut.native-image.base-image-run", defaultValue="frolvlad/alpine-glibc:alpine-3.12") protected String baseImageRun
protected AbstractDockerMojo(org.apache.maven.project.MavenProject mavenProject, JibConfigurationService jibConfigurationService, ApplicationConfigurationService applicationConfigurationService, DockerService dockerService)
protected org.apache.maven.artifact.versioning.ArtifactVersion javaVersion()
maven.compiler.target
property or the java.version
property.protected String graalVmVersion()
graalvm.version
property, which is expected to come from the
Micronaut Parent POM.protected String graalVmJvmVersion()
protected String graalVmArch()
os.arch
system property.protected String getFrom()
protected Optional<String> getFromImage()
protected Set<String> getTags()
protected String getPort()
protected void copyDependencies() throws IOException
target/dependency
directory.IOException
protected String getCmd()
protected String getGraalVmBuildArgs()
Copyright © 2020–2023 Micronaut. All rights reserved.