Interface BootArchive

All Superinterfaces:
Comparable<Task>, ExtensionAware, Named, Task
All Known Implementing Classes:
BootJar, BootWar

public interface BootArchive extends Task
A Spring Boot "fat" archive task.
Since:
2.0.0
Author:
Andy Wilkinson, Moritz Halbritter
  • Method Details

    • getMainClass

      @Input Property<String> getMainClass()
      Returns the fully-qualified name of the application's main class.
      Returns:
      the fully-qualified name of the application's main class
      Since:
      2.4.0
    • requiresUnpack

      void requiresUnpack(String... patterns)
      Adds Ant-style patterns that identify files that must be unpacked from the archive when it is launched.
      Parameters:
      patterns - the patterns
    • requiresUnpack

      void requiresUnpack(Spec<FileTreeElement> spec)
      Adds a spec that identifies files that must be unpacked from the archive when it is launched.
      Parameters:
      spec - the spec
    • getLaunchScript

      Returns the LaunchScriptConfiguration that will control the script that is prepended to the archive.
      Returns:
      the launch script configuration, or null if the launch script has not been configured.
    • launchScript

      void launchScript()
      Configures the archive to have a prepended launch script.
    • launchScript

      void launchScript(Action<LaunchScriptConfiguration> action)
      Configures the archive to have a prepended launch script, customizing its configuration using the given action.
      Parameters:
      action - the action to apply
    • getClasspath

      Returns the classpath that will be included in the archive.
      Returns:
      the classpath
    • classpath

      void classpath(Object... classpath)
      Adds files to the classpath to include in the archive. The given classpath is evaluated as per Project.files(Object...).
      Parameters:
      classpath - the additions to the classpath
    • setClasspath

      void setClasspath(Object classpath)
      Sets the classpath to include in the archive. The given classpath is evaluated as per Project.files(Object...).
      Parameters:
      classpath - the classpath
      Since:
      2.0.7
    • setClasspath

      void setClasspath(FileCollection classpath)
      Sets the classpath to include in the archive.
      Parameters:
      classpath - the classpath
      Since:
      2.0.7
    • getTargetJavaVersion

      @Input @Optional Property<JavaVersion> getTargetJavaVersion()
      Returns the target Java version of the project (e.g. as provided by the targetCompatibility build property).
      Returns:
      the target Java version
    • resolvedArtifacts

      void resolvedArtifacts(Provider<Set<ResolvedArtifactResult>> resolvedArtifacts)
      Registers the given lazily provided resolvedArtifacts. They are used to map from the files in the classpath to their dependency coordinates.
      Parameters:
      resolvedArtifacts - the lazily provided resolved artifacts
      Since:
      3.0.7
    • getLoaderImplementation

      @Input @Optional Property<org.springframework.boot.loader.tools.LoaderImplementation> getLoaderImplementation()
      The loader implementation that should be used with the archive.
      Returns:
      the loader implementation
      Since:
      3.2.0
    • getIncludeTools

      @Input Property<Boolean> getIncludeTools()
      Returns whether the JAR tools should be included as a dependency in the layered archive.
      Returns:
      whether the JAR tools should be included
      Since:
      3.3.0