Class TrainingRun
java.lang.Object
io.micronaut.maven.jdkaotcache.TrainingRun
The JDK AOT cache training run of an application: the mode, and what ends the run. It is resolved from
micronaut.docker.jdkAotCache.trainingMode, the training paths and what the application's Micronaut version can
do.
Without a configured mode, the run is a LOAD run if the Micronaut version has that mode, because it creates
no bean and so needs none of the services the beans use, which an image build does not have. Otherwise, it starts the
application, as every Micronaut version can.
- Since:
- 5.1.0
- Author:
- Álvaro Sánchez-Mariscal
-
Method Summary
Modifier and TypeMethodDescriptionvoidlog(org.apache.maven.plugin.logging.Log log) Writes what the run does and why to the build log, and the warning, if there is one.voidlogGeneratedDockerfileRun(org.apache.maven.plugin.logging.Log log) Writes whatlog(Log)writes and, for a run that starts the application, how the training script of the generated Dockerfile ends it.static TrainingRunresolve(@Nullable TrainingMode configured, List<String> trainingPaths, Collection<org.apache.maven.artifact.Artifact> artifacts) boolean
-
Method Details
-
resolve
public static TrainingRun resolve(@Nullable TrainingMode configured, List<String> trainingPaths, Collection<org.apache.maven.artifact.Artifact> artifacts) throws org.apache.maven.plugin.MojoExecutionException - Parameters:
configured- the configuredmicronaut.docker.jdkAotCache.trainingMode, ornullif it is not settrainingPaths- the validated training pathsartifacts- the resolved dependencies of the application- Returns:
- the training run
- Throws:
org.apache.maven.plugin.MojoExecutionException- if the application's Micronaut version cannot run the mode, or if training paths are set for a run that does not start the application
-
usesSwitch
- Returns:
- whether the Micronaut training-run switch ends the run. Otherwise, the training script warms the application up and stops it with SIGTERM
-
log
Writes what the run does and why to the build log, and the warning, if there is one.- Parameters:
log- the Maven log
-
logGeneratedDockerfileRun
Writes whatlog(Log)writes and, for a run that starts the application, how the training script of the generated Dockerfile ends it.- Parameters:
log- the Maven log
-
scriptArgument
- Returns:
- the argument that tells the training script how to run the application:
load,switchorsigterm
-