Class ServiceIndexGenerator.Request.Builder

java.lang.Object
io.micronaut.aot.serviceindex.ServiceIndexGenerator.Request.Builder
Enclosing class:
ServiceIndexGenerator.Request

@Internal public static final class ServiceIndexGenerator.Request.Builder extends Object
Builds a ServiceIndexGenerator.Request. At least one entry and the holder are required.
Since:
3.2.0
  • Method Details

    • entry

      Adds the next entry of the class path the application runs with, without a runtime name: the index then lists no class path, and micronaut-core does not compare it at run time. That is for a packaging that cannot know the names its files have when the application runs, such as Micronaut Runner's.

      Give the entries in the order of the class path at run time, as files of the machine that builds, once nothing changes them any more: for java -jar, the jar, then the entries of its manifest Class-Path that exist when the application runs. The class path cannot mix entries with and without a runtime name.

      Parameters:
      file - a jar or a directory
      Returns:
      this builder
    • entry

      public ServiceIndexGenerator.Request.Builder entry(Path file, String runtimeName)
      Adds the next entry of the class path the application runs with, and the file name it has when the application runs, which micronaut-core compares at run time: see entry(Path). A jar renamed after this step makes micronaut-core set the index aside, with a WARN on every start.
      Parameters:
      file - a jar or a directory
      runtimeName - the entry's file name when the application runs, such as application.jar
      Returns:
      this builder
    • holder

      The entry of the class path that the caller writes the ServiceIndexGenerator.Result into: the application's jar, or its class directory. A class directory must be a copy that only the packaged application uses, never build/classes or target/classes, which run tasks, tests and IDEs share: micronaut-core does not compare the content of a directory, so a bean compiled after this step would not be found. Required.
      Parameters:
      entry - one of the entries
      Returns:
      this builder
    • build

      Builds the request.
      Returns:
      the request
      Throws:
      IllegalStateException - if there is no entry or no holder, the holder is not an entry, an entry is given twice, or only some entries have a runtime name