Note
|
The Java library distribution plugin is currently incubating. Please be aware that the DSL and other configuration may change in later Gradle versions. |
The Java library distribution plugin adds support for building a distribution ZIP for a Java library. The distribution contains the JAR file for the library and its dependencies.
To use the Java library distribution plugin, include the following in your build script:
To define the name for the distribution you have to set the baseName
property as shown below:
The plugin builds a distribution for your library. The distribution will package up the runtime dependencies of the library. All files stored in src/main/dist
will be added to the root of the archive distribution. You can run “gradle distZip
” to create a ZIP file containing the distribution.
The Java library distribution plugin adds the following tasks to the project.
distZip
— Zip-
Depends on:
jar
Creates a full distribution ZIP archive including runtime libraries.