- # Getting Started
- # Default Java/Groovy Tasks
- # Shadowing Gradle Plugins
- All about shadow java
- Learn Latest Tutorials
- Preparation
- Trending Technologies
- B.Tech / MCA
- Javatpoint Services
- Training For College Campus
- # Introduction
- # Benefits of Shadow
- # Executable Distributions
- # Library Bundling
- All about shadow java
- Property Summary
- Constructor Summary
- Method Summary
- Methods inherited from class java.lang.Object
- Property Detail
- input
- radius
- width
- height
- blurType
- color
- Constructor Detail
- Shadow
- Shadow
- Shadow
- Method Detail
- setInput
- getInput
- inputProperty
- setRadius
- getRadius
- radiusProperty
- setWidth
- getWidth
- widthProperty
- setHeight
- getHeight
- heightProperty
- setBlurType
- getBlurType
- blurTypeProperty
- setColor
- getColor
- colorProperty
# Getting Started
Alternatively, the plugin can be added to the buildscript classpath and applied:
buildscript repositories gradlePluginPortal() > dependencies classpath 'com.github.johnrengelman:shadow:8.1.1' > > apply plugin: 'com.github.johnrengelman.shadow' apply plugin: 'java'
NOTE: The correct maven coordinates for each version of Shadow can be found by referencing the Gradle Plugin documentation here (opens new window)
Shadow is a reactive plugin. This means that applying Shadow by itself will perform no configuration on your project. Instead, Shadow reacts This means, that for most users, the java or groovy plugins must be explicitly applied to have the desired effect.
# Default Java/Groovy Tasks
In the presence of the java or groovy plugins, Shadow will automatically configure the following behavior:
- Adds a shadowJar task to the project.
- Adds a shadow configuration to the project.
- Configures the shadowJar task to include all sources from the project’s main sourceSet.
- Configures the shadowJar task to bundle all dependencies from the runtimeClasspath configuration.
- Configures the classifier attribute of the shadowJar task to be ‘all’ .
- Configures the shadowJar task to generate a Manifest with:
- Inheriting all configuration from the standard jar task.
- Adds a Class-Path attribute to the Manifest that appends all dependencies from the shadow configuration
- META-INF/INDEX.LIST
- META-INF/*.SF
- META-INF/*.DSA
- META-INF/*.RSA
# Shadowing Gradle Plugins
Shadow ships with a companion task that can be used to automatically discover dependency packages and configure them for relocation. This is useful in projects if you want to relocate all dependencies.
All about shadow java
Learn Latest Tutorials
Preparation
Trending Technologies
B.Tech / MCA
Javatpoint Services
JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.
- Website Designing
- Website Development
- Java Development
- PHP Development
- WordPress
- Graphic Designing
- Logo
- Digital Marketing
- On Page and Off Page SEO
- PPC
- Content Development
- Corporate Training
- Classroom and Online Training
- Data Entry
Training For College Campus
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 weekLike/Subscribe us for latest updates or newsletter
# Introduction
Shadow is a Gradle plugin for combining a project’s dependency classes and resources into a single output Jar. The combined Jar is often referred to a fat-jar or uber-jar. Shadow utilizes JarInputStream (opens new window)
to efficiently process dependent libraries into the output jar without incurring the I/O overhead of expanding the jars to disk.
# Benefits of Shadow
Shadowing a project output has 2 major use cases:
- Creating an executable JAR distribution
- Bundling and relocating common dependencies in libraries to avoid classpath conflicts
# Executable Distributions
Executable distribution is the main use case for deploying an application that can be executed/run in the runtime environment. In the case of Shadow, this is a single uber or fat JAR. The JAR file contains all the application code and dependent libraries to execute (not including the standard JVM libraries). The shadow JAR does not include the JRE itself. It must be available on the target system.
Executable JARs contain a JAR MANIFEST that specifies the application Main Class. This allows the application to be started with a single command:
$ java -jar application-shadow.jar
# Library Bundling
Dependency bundling and relocation is the main use case for library authors. The goal of a bundled library is to create a pre-packaged dependency for other libraries or applications to utilize. Often in these scenarios, a library may contain a dependency that a downstream library or application also uses. In some cases, different versions of this common dependency can cause an issue in either the upstream library or the downstream application. These issues often manifest themselves as binary incompatibilities in either the library or application code.
By utilizing Shadow’s ability to relocate the package names for dependencies, a library author can ensure that the library’s dependencies will not conflict with the same dependency being declared by the downstream application.
All about shadow java
An effect which creates a monochrome duplicate of an input with blurry edges. This effect is primarily used along with its default black color for purposes of combining it with the original to create a shadow. It can also be used with a light color and combined with an original to create a glow effect. The DropShadow effect is a utility effect which automatically combines this Shadow effect with an original graphic for ease of adding a shadow to an existing scene graph Node with a single effect.
Property Summary
Constructor Summary
Method Summary
Methods inherited from class java.lang.Object
Property Detail
input
The input for this Effect . If set to null , or left unspecified, a graphical image of the Node to which the Effect is attached will be used as the input.
radius
The radius of the shadow blur kernel. This attribute controls the distance that the shadow is spread to each side of the source pixels. Setting the radius is equivalent to setting both the width and height attributes to a value of (2 * radius + 1) .
Min: 0.0 Max: 127.0 Default: 10.0 Identity: 0.0
width
The horizontal size of the shadow blur kernel. This attribute controls the horizontal size of the total area over which the shadow of a single pixel is distributed by the blur algorithm. Values less than 1.0 are not distributed beyond the original pixel and so have no blurring effect on the shadow.
Min: 0.0 Max: 255.0 Default: 21.0 Identity:
height
The vertical size of the shadow blur kernel. This attribute controls the vertical size of the total area over which the shadow of a single pixel is distributed by the blur algorithm. Values less than 1.0 are not distributed beyond the original pixel and so have no blurring effect on the shadow.
Min: 0.0 Max: 255.0 Default: 21.0 Identity:
blurType
public final ObjectPropertyBlurType> blurTypeProperty
Min: n/a Max: n/a Default: BlurType.THREE_PASS_BOX Identity: n/a
color
Min: n/a Max: n/a Default: Color.BLACK Identity: n/a
Constructor Detail
Shadow
Shadow
Shadow
public Shadow(BlurType blurType, Color color, double radius)
Method Detail
setInput
getInput
inputProperty
The input for this Effect . If set to null , or left unspecified, a graphical image of the Node to which the Effect is attached will be used as the input.
setRadius
public final void setRadius(double value)
Property description: The radius of the shadow blur kernel. This attribute controls the distance that the shadow is spread to each side of the source pixels. Setting the radius is equivalent to setting both the width and height attributes to a value of (2 * radius + 1) .
Min: 0.0 Max: 127.0 Default: 10.0 Identity: 0.0
getRadius
public final double getRadius()
Property description: The radius of the shadow blur kernel. This attribute controls the distance that the shadow is spread to each side of the source pixels. Setting the radius is equivalent to setting both the width and height attributes to a value of (2 * radius + 1) .
Min: 0.0 Max: 127.0 Default: 10.0 Identity: 0.0
radiusProperty
The radius of the shadow blur kernel. This attribute controls the distance that the shadow is spread to each side of the source pixels. Setting the radius is equivalent to setting both the width and height attributes to a value of (2 * radius + 1) .
Min: 0.0 Max: 127.0 Default: 10.0 Identity: 0.0
setWidth
public final void setWidth(double value)
Property description: The horizontal size of the shadow blur kernel. This attribute controls the horizontal size of the total area over which the shadow of a single pixel is distributed by the blur algorithm. Values less than 1.0 are not distributed beyond the original pixel and so have no blurring effect on the shadow.
Min: 0.0 Max: 255.0 Default: 21.0 Identity:
getWidth
public final double getWidth()
Property description: The horizontal size of the shadow blur kernel. This attribute controls the horizontal size of the total area over which the shadow of a single pixel is distributed by the blur algorithm. Values less than 1.0 are not distributed beyond the original pixel and so have no blurring effect on the shadow.
Min: 0.0 Max: 255.0 Default: 21.0 Identity:
widthProperty
The horizontal size of the shadow blur kernel. This attribute controls the horizontal size of the total area over which the shadow of a single pixel is distributed by the blur algorithm. Values less than 1.0 are not distributed beyond the original pixel and so have no blurring effect on the shadow.
Min: 0.0 Max: 255.0 Default: 21.0 Identity:
setHeight
public final void setHeight(double value)
Property description: The vertical size of the shadow blur kernel. This attribute controls the vertical size of the total area over which the shadow of a single pixel is distributed by the blur algorithm. Values less than 1.0 are not distributed beyond the original pixel and so have no blurring effect on the shadow.
Min: 0.0 Max: 255.0 Default: 21.0 Identity:
getHeight
public final double getHeight()
Property description: The vertical size of the shadow blur kernel. This attribute controls the vertical size of the total area over which the shadow of a single pixel is distributed by the blur algorithm. Values less than 1.0 are not distributed beyond the original pixel and so have no blurring effect on the shadow.
Min: 0.0 Max: 255.0 Default: 21.0 Identity:
heightProperty
The vertical size of the shadow blur kernel. This attribute controls the vertical size of the total area over which the shadow of a single pixel is distributed by the blur algorithm. Values less than 1.0 are not distributed beyond the original pixel and so have no blurring effect on the shadow.
Min: 0.0 Max: 255.0 Default: 21.0 Identity:
setBlurType
Min: n/a Max: n/a Default: BlurType.THREE_PASS_BOX Identity: n/a
getBlurType
Min: n/a Max: n/a Default: BlurType.THREE_PASS_BOX Identity: n/a
blurTypeProperty
public final ObjectPropertyBlurType> blurTypeProperty()
Min: n/a Max: n/a Default: BlurType.THREE_PASS_BOX Identity: n/a
setColor
Min: n/a Max: n/a Default: Color.BLACK Identity: n/a
getColor
Min: n/a Max: n/a Default: Color.BLACK Identity: n/a
colorProperty
Min: n/a Max: n/a Default: Color.BLACK Identity: n/a