Gradle User Manual
Version 4.5.1
Table of Contents
About Gradle
Introduction
Overview
Working with existing builds
Installing Gradle
Command-Line Interface
The Gradle Wrapper
The Gradle Daemon
Dependency Management for Java Projects
Executing Multi-Project Builds
Continuous build
Composite builds
Build Environment
Troubleshooting
Embedding Gradle using the Tooling API
Build Cache
Writing Gradle build scripts
Build Script Basics
Build Init Plugin
Writing Build Scripts
Authoring Tasks
Working With Files
Using Ant from Gradle
Build Lifecycle
Logging
Authoring Multi-Project Builds
Using Gradle Plugins
Standard Gradle plugins
The Project Report Plugin
The Build Dashboard Plugin
Comparing Builds
Publishing artifacts
The Maven Plugin
The Signing Plugin
Ivy Publishing (new)
Maven Publishing (new)
The Distribution Plugin
The Announce Plugin
The Build Announcements Plugin
Dependency management
Introduction to Dependency Management
Declaring Dependencies
Declaring Repositories
Inspecting Dependencies
Managing Transitive Dependencies
Working with Dependencies
Customizing Dependency Resolution Behavior
Troubleshooting Dependency Resolution
Extending the build
Writing Custom Task Classes
Writing Custom Plugins
Gradle Plugin Development Plugin
Organizing Build Logic
Lazy Configuration
Initialization Scripts
Testing Build Logic with TestKit
Building JVM projects
Java Quickstart
The Java Plugin
The Java Library Plugin
Web Application Quickstart
The War Plugin
The Ear Plugin
The Jetty Plugin
The Application Plugin
The Java Library Distribution Plugin
Groovy Quickstart
The Groovy Plugin
The Scala Plugin
The ANTLR Plugin
The Checkstyle Plugin
The CodeNarc Plugin
The FindBugs Plugin
The JDepend Plugin
The PMD Plugin
The JaCoCo Plugin
The OSGi Plugin
The Eclipse Plugins
The IDEA Plugin
The Software model
Rule based model configuration
Software model concepts
Implementing model rules in a plugin
Building Java Libraries
Building Play applications
Building native software
Extending the software model
Glossary
Dependency Types
Repository Types
Appendix
A. Gradle Samples
B. Potential Traps
C. The Feature Lifecycle
D. Documentation licenses
List of Examples
1. Excluding tasks
2. Abbreviated camel case task name
3. Obtaining detailed help for tasks
4. Information about properties
5. Running the Wrapper task
6. The generated distribution URL
7. Providing options to Wrapper task
8. The generated distribution URL
9. Executing the build with the Wrapper batch file
10. Upgrading the Wrapper version
11. Checking the Wrapper version after upgrading
12. Customizing the Wrapper task
13. The generated distribution URL
14. Specifying the HTTP Basic Authentication credentials using system properties
15. Specifying the HTTP Basic Authentication credentials in distributionUrl
16. Configuring SHA-256 checksum verification
17. Declaring dependencies
18. Definition of an external dependency
19. Shortcut definition of an external dependency
20. Usage of Maven central repository
21. Usage of JCenter repository
22. Usage of a remote Maven repository
23. Usage of a remote Ivy directory
24. Usage of a local Ivy directory
25. Publishing to an Ivy repository
26. Publishing to a Maven repository
27. Listing the projects in a build
28. Dependencies of my-app
29. Declaring a command-line composite
30. Declaring a separate composite
31. Depending on task from included build
32. Build that does not declare group attribute
33. Declaring the substitutions for an included build
34. Depending on a single task from an included build
35. Depending on a tasks with path in all included builds
36. Setting properties with a gradle.properties file
37. Specifying system properties in gradle.properties
38. Setting a project property via gradle.properties
39. Setting a project property via environment variable
40. Changing JVM settings for Gradle client JVM
41. Changing JVM settings for forked Gradle JVMs
42. Set Java compile options for tasksJavaCompile
43. Prevent releasing outside of CI
44. Configuring an HTTP proxy using gradle.properties
45. Configuring an HTTPS proxy using gradle.properties
46. Using the tooling API
47. Configure the local cache