Class JdkAotCacheDockerContext

java.lang.Object
io.micronaut.maven.jdkaotcache.JdkAotCacheDockerContext

@Internal public final class JdkAotCacheDockerContext extends Object
Writes the files that a Dockerfile generated with micronaut.docker.jdkAotCache copies from the build context: an application JAR, the class path argument file and the training script. A JDK AOT cache cannot record classes from a non-empty directory on the class path, so the classes go into a JAR, listed after the dependencies, as the classes directory is in the default Dockerfile. The dependencies are listed one by one, in the order of the Maven class path, because the JDK leaves the expansion order of * entries unspecified.
Since:
5.1.0
Author:
Álvaro Sánchez-Mariscal
  • Method Details

    • write

      public static void write(Path buildDirectory, Path classesDirectory, List<String> dependencies) throws IOException
      Writes the application JAR, the class path argument file and the training script to jdk-aot-cache in the build context.
      Parameters:
      buildDirectory - the build context, usually target
      classesDirectory - the compiled classes and resources
      dependencies - the dependency JARs in class path order, as paths relative to the directory that the generated Dockerfile copies them to, such as release/foo.jar
      Throws:
      IOException - if a file cannot be written