所有已实现的接口:
Comparable<Task>, ContentFilterable, CopyProcessingSpec, CopySourceSpec, CopySpec, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.file.copy.CopySpecSource, org.gradle.api.internal.IConventionAware, org.gradle.api.internal.TaskInternal, Named, ExtensionAware, Task, PatternFilterable, Configurable<Task>, BootArchive

@DisableCachingByDefault(because="Not worth caching") public abstract class BootJar extends Jar implements BootArchive
A custom Jar task that produces a Spring Boot executable jar.
从以下版本开始:
2.0.0
作者:
Andy Wilkinson, Madhura Bhave, Scott Frederick, Phillip Webb
  • 构造器详细资料

    • BootJar

      public BootJar()
      Creates a new BootJar task.
  • 方法详细资料

    • resolvedArtifacts

      public void resolvedArtifacts(Provider<Set<ResolvedArtifactResult>> resolvedArtifacts)
      从接口复制的说明: BootArchive
      Registers the given lazily provided resolvedArtifacts. They are used to map from the files in the classpath to their dependency coordinates.
      指定者:
      resolvedArtifacts 在接口中 BootArchive
      参数:
      resolvedArtifacts - the lazily provided resolved artifacts
    • copy

      public void copy()
      覆盖:
      copy 在类中 AbstractCopyTask
    • createCopyAction

      protected org.gradle.api.internal.file.copy.CopyAction createCopyAction()
      覆盖:
      createCopyAction 在类中 Zip
    • requiresUnpack

      public void requiresUnpack(String... patterns)
      从接口复制的说明: BootArchive
      Adds Ant-style patterns that identify files that must be unpacked from the archive when it is launched.
      指定者:
      requiresUnpack 在接口中 BootArchive
      参数:
      patterns - the patterns
    • requiresUnpack

      public void requiresUnpack(Spec<FileTreeElement> spec)
      从接口复制的说明: BootArchive
      Adds a spec that identifies files that must be unpacked from the archive when it is launched.
      指定者:
      requiresUnpack 在接口中 BootArchive
      参数:
      spec - the spec
    • getLaunchScript

      public LaunchScriptConfiguration getLaunchScript()
      从接口复制的说明: BootArchive
      Returns the LaunchScriptConfiguration that will control the script that is prepended to the archive.
      指定者:
      getLaunchScript 在接口中 BootArchive
      返回:
      the launch script configuration, or null if the launch script has not been configured.
    • launchScript

      public void launchScript()
      从接口复制的说明: BootArchive
      Configures the archive to have a prepended launch script.
      指定者:
      launchScript 在接口中 BootArchive
    • launchScript

      public void launchScript(Action<LaunchScriptConfiguration> action)
      从接口复制的说明: BootArchive
      Configures the archive to have a prepended launch script, customizing its configuration using the given action.
      指定者:
      launchScript 在接口中 BootArchive
      参数:
      action - the action to apply
    • getLayered

      public LayeredSpec getLayered()
      Returns the spec that describes the layers in a layered jar.
      返回:
      the spec for the layers
      从以下版本开始:
      2.3.0
    • layered

      public void layered(Action<LayeredSpec> action)
      Configures the jar's layering using the given action.
      参数:
      action - the action to apply
      从以下版本开始:
      2.3.0
    • getClasspath

      public FileCollection getClasspath()
      从接口复制的说明: BootArchive
      Returns the classpath that will be included in the archive.
      指定者:
      getClasspath 在接口中 BootArchive
      返回:
      the classpath
    • classpath

      public void classpath(Object... classpath)
      从接口复制的说明: BootArchive
      Adds files to the classpath to include in the archive. The given classpath is evaluated as per Project.files(Object...).
      指定者:
      classpath 在接口中 BootArchive
      参数:
      classpath - the additions to the classpath
    • setClasspath

      public void setClasspath(Object classpath)
      从接口复制的说明: BootArchive
      Sets the classpath to include in the archive. The given classpath is evaluated as per Project.files(Object...).
      指定者:
      setClasspath 在接口中 BootArchive
      参数:
      classpath - the classpath
    • setClasspath

      public void setClasspath(FileCollection classpath)
      从接口复制的说明: BootArchive
      Sets the classpath to include in the archive.
      指定者:
      setClasspath 在接口中 BootArchive
      参数:
      classpath - the classpath
    • getBootInf

      @Internal public CopySpec getBootInf()
      Returns a CopySpec that can be used to add content to the BOOT-INF directory of the jar.
      返回:
      a CopySpec for BOOT-INF
      从以下版本开始:
      2.0.3
    • bootInf

      public CopySpec bootInf(Action<CopySpec> action)
      Calls the given action to add content to the BOOT-INF directory of the jar.
      参数:
      action - the Action to call
      返回:
      the CopySpec for BOOT-INF that was passed to the Action
      从以下版本开始:
      2.0.3
    • resolveZipCompression

      protected ZipCompression resolveZipCompression(FileCopyDetails details)
      Return the ZipCompression that should be used when adding the file represented by the given details to the jar. By default, any library is stored and all other files are deflated.
      参数:
      details - the file copy details
      返回:
      the compression to use
    • isLibrary

      protected boolean isLibrary(FileCopyDetails details)
      Return if the FileCopyDetails are for a library. By default any file in BOOT-INF/lib is considered to be a library.
      参数:
      details - the file copy details
      返回:
      true if the details are for a library
      从以下版本开始:
      2.3.0