Class ShadowJar

  • All Implemented Interfaces:
    java.lang.Comparable<org.gradle.api.Task>, org.gradle.api.file.ContentFilterable, org.gradle.api.file.CopyProcessingSpec, org.gradle.api.file.CopySourceSpec, org.gradle.api.file.CopySpec, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.file.copy.CopySpecSource, org.gradle.api.internal.IConventionAware, org.gradle.api.internal.TaskInternal, org.gradle.api.plugins.ExtensionAware, org.gradle.api.Task, org.gradle.api.tasks.util.PatternFilterable, org.gradle.util.Configurable<org.gradle.api.Task>

    @CacheableTask
    public class ShadowJar
    extends org.gradle.api.tasks.bundling.Jar
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.gradle.api.Task

        org.gradle.api.Task.Namer
    • Field Summary

      • Fields inherited from class org.gradle.jvm.tasks.Jar

        DEFAULT_EXTENSION
      • Fields inherited from class org.gradle.api.tasks.bundling.Zip

        ZIP_EXTENSION
      • Fields inherited from interface org.gradle.api.Task

        TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
    • Constructor Summary

      Constructors 
      Constructor Description
      ShadowJar()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ShadowJar append​(java.lang.String resourcePath)
      Syntax sugar for merging service files in JARs
      protected void copy()  
      protected org.gradle.api.internal.file.copy.CopyAction createCopyAction()  
      ShadowJar dependencies​(org.gradle.api.Action<com.github.jengelman.gradle.plugins.shadow.internal.DependencyFilter> c)
      Configure inclusion/exclusion of module and project dependencies into uber jar.
      java.util.List<org.gradle.api.file.FileCollection> getConfigurations()  
      com.github.jengelman.gradle.plugins.shadow.internal.DependencyFilter getDependencyFilter()  
      org.gradle.api.file.FileCollection getIncludedDependencies()  
      protected com.github.jengelman.gradle.plugins.shadow.internal.ZipCompressor getInternalCompressor()  
      com.github.jengelman.gradle.plugins.shadow.tasks.InheritManifest getManifest()  
      java.util.List<com.github.jengelman.gradle.plugins.shadow.relocation.Relocator> getRelocators()  
      protected org.gradle.api.tasks.util.PatternSet getRootPatternSet()
      Utility method for assisting between changes in Gradle 1.12 and 2.x.
      com.github.jengelman.gradle.plugins.shadow.ShadowStats getStats()  
      java.util.List<com.github.jengelman.gradle.plugins.shadow.transformers.Transformer> getTransformers()  
      ShadowJar mergeGroovyExtensionModules()
      Syntactic sugar for merging Groovy extension module descriptor files in JARs
      ShadowJar mergeServiceFiles()
      Syntactic sugar for merging service files in JARs.
      ShadowJar mergeServiceFiles​(java.lang.String rootPath)
      Syntactic sugar for merging service files in JARs.
      ShadowJar mergeServiceFiles​(org.gradle.api.Action<com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransformer> configureClosure)
      Syntactic sugar for merging service files in JARs.
      ShadowJar minimize()  
      ShadowJar minimize​(org.gradle.api.Action<com.github.jengelman.gradle.plugins.shadow.internal.DependencyFilter> c)  
      ShadowJar relocate​(com.github.jengelman.gradle.plugins.shadow.relocation.Relocator relocator)
      Add a relocator instance.
      ShadowJar relocate​(java.lang.Class<? extends com.github.jengelman.gradle.plugins.shadow.relocation.Relocator> relocatorClass)
      Add a relocator of the provided class.
      <R extends com.github.jengelman.gradle.plugins.shadow.relocation.Relocator>
      ShadowJar
      relocate​(java.lang.Class<R> relocatorClass, org.gradle.api.Action<R> configure)
      Add a relocator of the provided class and configure.
      ShadowJar relocate​(java.lang.String pattern, java.lang.String destination)
      Add a class relocator that maps each class in the pattern to the provided destination.
      ShadowJar relocate​(java.lang.String pattern, java.lang.String destination, org.gradle.api.Action<com.github.jengelman.gradle.plugins.shadow.relocation.SimpleRelocator> configure)
      Add a class relocator that maps each class in the pattern to the provided destination.
      void setConfigurations​(java.util.List<org.gradle.api.file.FileCollection> configurations)  
      void setDependencyFilter​(com.github.jengelman.gradle.plugins.shadow.internal.DependencyFilter filter)  
      void setRelocators​(java.util.List<com.github.jengelman.gradle.plugins.shadow.relocation.Relocator> relocators)  
      void setTransformers​(java.util.List<com.github.jengelman.gradle.plugins.shadow.transformers.Transformer> transformers)  
      ShadowJar transform​(com.github.jengelman.gradle.plugins.shadow.transformers.Transformer transformer)
      Add a preconfigured transformer instance.
      ShadowJar transform​(java.lang.Class<? extends com.github.jengelman.gradle.plugins.shadow.transformers.Transformer> clazz)
      Add a Transformer instance for modifying JAR resources and configure.
      <T extends com.github.jengelman.gradle.plugins.shadow.transformers.Transformer>
      ShadowJar
      transform​(java.lang.Class<T> clazz, org.gradle.api.Action<T> c)
      Add a Transformer instance for modifying JAR resources and configure.
      • Methods inherited from class org.gradle.api.tasks.bundling.Jar

        manifest
      • Methods inherited from class org.gradle.jvm.tasks.Jar

        getManifestContentCharset, getMetadataCharset, getMetaInf, manifest, metaInf, metaInf, setManifest, setManifestContentCharset, setMetadataCharset
      • Methods inherited from class org.gradle.api.tasks.bundling.Zip

        getCompressor, getEntryCompression, isZip64, setEntryCompression, setZip64
      • Methods inherited from class org.gradle.api.tasks.bundling.AbstractArchiveTask

        createCopyActionExecuter, getAppendix, getArchiveAppendix, getArchiveBaseName, getArchiveClassifier, getArchiveExtension, getArchiveFile, getArchiveFileName, getArchiveName, getArchivePath, getArchiveVersion, getBaseName, getClassifier, getDestinationDir, getDestinationDirectory, getExtension, getVersion, into, into, into, isPreserveFileTimestamps, isReproducibleFileOrder, setAppendix, setArchiveName, setBaseName, setClassifier, setDestinationDir, setExtension, setPreserveFileTimestamps, setReproducibleFileOrder, setVersion
      • Methods inherited from class org.gradle.api.tasks.AbstractCopyTask

        createRootSpec, eachFile, eachFile, exclude, exclude, exclude, exclude, expand, filesMatching, filesMatching, filesNotMatching, filesNotMatching, filter, filter, filter, filter, from, from, from, getDirectoryFileTreeFactory, getDirMode, getDocumentationRegistry, getDuplicatesStrategy, getExcludes, getFileLookup, getFileMode, getFileResolver, getFileSystem, getFilteringCharset, getIncludeEmptyDirs, getIncludes, getInstantiator, getMainSpec, getRootSpec, getSource, include, include, include, include, isCaseSensitive, rename, rename, rename, rename, setCaseSensitive, setDirMode, setDuplicatesStrategy, setExcludes, setFileMode, setFilteringCharset, setIncludeEmptyDirs, setIncludes, with
      • Methods inherited from class org.gradle.api.internal.ConventionTask

        conventionMapping, conventionMapping, getConventionMapping
      • Methods inherited from class org.gradle.api.DefaultTask

        compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService
      • Methods inherited from class org.gradle.api.internal.AbstractTask

        appendParallelSafeAction, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getOnlyIf, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isEnabled, isHasCustomActions, prependParallelSafeAction, setImpliesSubProjects
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.gradle.api.file.CopyProcessingSpec

        getDirMode, getFileMode, setDirMode, setFileMode
      • Methods inherited from interface org.gradle.api.file.CopySpec

        eachFile, eachFile, exclude, exclude, exclude, exclude, expand, filesMatching, filesMatching, filesNotMatching, filesNotMatching, filter, filter, filter, filter, from, from, from, getDuplicatesStrategy, getFilteringCharset, getIncludeEmptyDirs, include, include, include, include, into, into, into, isCaseSensitive, rename, rename, rename, rename, setCaseSensitive, setDuplicatesStrategy, setExcludes, setFilteringCharset, setIncludeEmptyDirs, setIncludes, with
      • Methods inherited from interface org.gradle.api.tasks.util.PatternFilterable

        getExcludes, getIncludes
      • Methods inherited from interface org.gradle.api.Task

        getConvention
    • Constructor Detail

      • ShadowJar

        public ShadowJar()
    • Method Detail

      • minimize

        public ShadowJar minimize​(org.gradle.api.Action<com.github.jengelman.gradle.plugins.shadow.internal.DependencyFilter> c)
      • getStats

        @Internal
        public com.github.jengelman.gradle.plugins.shadow.ShadowStats getStats()
      • getManifest

        public com.github.jengelman.gradle.plugins.shadow.tasks.InheritManifest getManifest()
        Overrides:
        getManifest in class org.gradle.jvm.tasks.Jar
      • createCopyAction

        protected org.gradle.api.internal.file.copy.CopyAction createCopyAction()
        Overrides:
        createCopyAction in class org.gradle.api.tasks.bundling.Zip
      • getInternalCompressor

        @Internal
        protected com.github.jengelman.gradle.plugins.shadow.internal.ZipCompressor getInternalCompressor()
      • copy

        protected void copy()
        Overrides:
        copy in class org.gradle.api.tasks.AbstractCopyTask
      • getIncludedDependencies

        @Classpath
        public org.gradle.api.file.FileCollection getIncludedDependencies()
      • getRootPatternSet

        @Internal
        protected org.gradle.api.tasks.util.PatternSet getRootPatternSet()
        Utility method for assisting between changes in Gradle 1.12 and 2.x.
        Returns:
        this
      • dependencies

        public ShadowJar dependencies​(org.gradle.api.Action<com.github.jengelman.gradle.plugins.shadow.internal.DependencyFilter> c)
        Configure inclusion/exclusion of module and project dependencies into uber jar.
        Parameters:
        c - the configuration of the filter
        Returns:
        this
      • transform

        public ShadowJar transform​(java.lang.Class<? extends com.github.jengelman.gradle.plugins.shadow.transformers.Transformer> clazz)
                            throws java.lang.InstantiationException,
                                   java.lang.IllegalAccessException,
                                   java.lang.NoSuchMethodException,
                                   java.lang.reflect.InvocationTargetException
        Add a Transformer instance for modifying JAR resources and configure.
        Parameters:
        clazz - the transformer to add. Must have a no-arg constructor
        Returns:
        this
        Throws:
        java.lang.InstantiationException
        java.lang.IllegalAccessException
        java.lang.NoSuchMethodException
        java.lang.reflect.InvocationTargetException
      • transform

        public <T extends com.github.jengelman.gradle.plugins.shadow.transformers.Transformer> ShadowJar transform​(java.lang.Class<T> clazz,
                                                                                                                   org.gradle.api.Action<T> c)
                                                                                                            throws java.lang.InstantiationException,
                                                                                                                   java.lang.IllegalAccessException,
                                                                                                                   java.lang.NoSuchMethodException,
                                                                                                                   java.lang.reflect.InvocationTargetException
        Add a Transformer instance for modifying JAR resources and configure.
        Parameters:
        clazz - the transformer class to add. Must have no-arg constructor
        c - the configuration for the transformer
        Returns:
        this
        Throws:
        java.lang.InstantiationException
        java.lang.IllegalAccessException
        java.lang.NoSuchMethodException
        java.lang.reflect.InvocationTargetException
      • transform

        public ShadowJar transform​(com.github.jengelman.gradle.plugins.shadow.transformers.Transformer transformer)
        Add a preconfigured transformer instance.
        Parameters:
        transformer - the transformer instance to add
        Returns:
        this
      • mergeServiceFiles

        public ShadowJar mergeServiceFiles()
        Syntactic sugar for merging service files in JARs.
        Returns:
        this
      • mergeServiceFiles

        public ShadowJar mergeServiceFiles​(java.lang.String rootPath)
        Syntactic sugar for merging service files in JARs.
        Returns:
        this
      • mergeServiceFiles

        public ShadowJar mergeServiceFiles​(org.gradle.api.Action<com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransformer> configureClosure)
        Syntactic sugar for merging service files in JARs.
        Returns:
        this
      • mergeGroovyExtensionModules

        public ShadowJar mergeGroovyExtensionModules()
        Syntactic sugar for merging Groovy extension module descriptor files in JARs
        Returns:
        this
      • append

        public ShadowJar append​(java.lang.String resourcePath)
        Syntax sugar for merging service files in JARs
        Returns:
        this
      • relocate

        public ShadowJar relocate​(java.lang.String pattern,
                                  java.lang.String destination)
        Add a class relocator that maps each class in the pattern to the provided destination.
        Parameters:
        pattern - the source pattern to relocate
        destination - the destination package
        Returns:
        this
      • relocate

        public ShadowJar relocate​(java.lang.String pattern,
                                  java.lang.String destination,
                                  org.gradle.api.Action<com.github.jengelman.gradle.plugins.shadow.relocation.SimpleRelocator> configure)
        Add a class relocator that maps each class in the pattern to the provided destination.
        Parameters:
        pattern - the source pattern to relocate
        destination - the destination package
        configure - the configuration of the relocator
        Returns:
        this
      • relocate

        public ShadowJar relocate​(com.github.jengelman.gradle.plugins.shadow.relocation.Relocator relocator)
        Add a relocator instance.
        Parameters:
        relocator - the relocator instance to add
        Returns:
        this
      • relocate

        public ShadowJar relocate​(java.lang.Class<? extends com.github.jengelman.gradle.plugins.shadow.relocation.Relocator> relocatorClass)
                           throws java.lang.InstantiationException,
                                  java.lang.IllegalAccessException,
                                  java.lang.NoSuchMethodException,
                                  java.lang.reflect.InvocationTargetException
        Add a relocator of the provided class.
        Parameters:
        relocatorClass - the relocator class to add. Must have a no-arg constructor.
        Returns:
        this
        Throws:
        java.lang.InstantiationException
        java.lang.IllegalAccessException
        java.lang.NoSuchMethodException
        java.lang.reflect.InvocationTargetException
      • relocate

        public <R extends com.github.jengelman.gradle.plugins.shadow.relocation.Relocator> ShadowJar relocate​(java.lang.Class<R> relocatorClass,
                                                                                                              org.gradle.api.Action<R> configure)
                                                                                                       throws java.lang.InstantiationException,
                                                                                                              java.lang.IllegalAccessException,
                                                                                                              java.lang.NoSuchMethodException,
                                                                                                              java.lang.reflect.InvocationTargetException
        Add a relocator of the provided class and configure.
        Parameters:
        relocatorClass - the relocator class to add. Must have a no-arg constructor
        configure - the configuration for the relocator
        Returns:
        this
        Throws:
        java.lang.InstantiationException
        java.lang.IllegalAccessException
        java.lang.NoSuchMethodException
        java.lang.reflect.InvocationTargetException
      • getTransformers

        public java.util.List<com.github.jengelman.gradle.plugins.shadow.transformers.Transformer> getTransformers()
      • setTransformers

        public void setTransformers​(java.util.List<com.github.jengelman.gradle.plugins.shadow.transformers.Transformer> transformers)
      • getRelocators

        public java.util.List<com.github.jengelman.gradle.plugins.shadow.relocation.Relocator> getRelocators()
      • setRelocators

        public void setRelocators​(java.util.List<com.github.jengelman.gradle.plugins.shadow.relocation.Relocator> relocators)
      • getConfigurations

        @Classpath
        @Optional
        public java.util.List<org.gradle.api.file.FileCollection> getConfigurations()
      • setConfigurations

        public void setConfigurations​(java.util.List<org.gradle.api.file.FileCollection> configurations)
      • getDependencyFilter

        @Internal
        public com.github.jengelman.gradle.plugins.shadow.internal.DependencyFilter getDependencyFilter()
      • setDependencyFilter

        public void setDependencyFilter​(com.github.jengelman.gradle.plugins.shadow.internal.DependencyFilter filter)