Gradle User Guide
Version 4.4.1
Copyright © 2007-2017 Hans Dockter, Adam Murdoch
Copies of this document may be made for your own use and for distribution to others, provided that you do
not charge any fee for such copies and further provided that each copy contains this Copyright Notice,
whether distributed in print or electronically.
Table of Contents
I. About Gradle
1. Introduction
2. Overview
II. Working with existing builds
3. Installing Gradle
4. Using the Gradle Command-Line
5. The Gradle Console
6. The Gradle Wrapper
7. The Gradle Daemon
8. Dependency Management Basics
9. Introduction to multi-project builds
10. Continuous build
11. Composite builds
12. The Build Environment
13. Troubleshooting
14. Embedding Gradle using the Tooling API
15. Build Cache
III. Writing Gradle build scripts
16. Build Script Basics
17. Build Init Plugin
18. Writing Build Scripts
19. More about Tasks
20. Working With Files
21. Using Ant from Gradle
22. The Build Lifecycle
23. Wrapper Plugin
24. Logging
25. Dependency Management
26. Multi-project Builds
27. Gradle Plugins
28. Standard Gradle plugins
29. The Project Report Plugin
30. The Build Dashboard Plugin
31. Comparing Builds
32. Publishing artifacts
33. The Maven Plugin
34. The Signing Plugin
35. Ivy Publishing (new)
36. Maven Publishing (new)
37. The Distribution Plugin
38. The Announce Plugin
39. The Build Announcements Plugin
IV. Extending the build
40. Writing Custom Task Classes
41. Writing Custom Plugins
42. The Java Gradle Plugin Development Plugin
43. Organizing Build Logic
44. Lazy Configuration
45. Initialization Scripts
46. The Gradle TestKit
V. Building JVM projects
47. Java Quickstart
48. The Java Plugin
49. The Java Library Plugin
50. Web Application Quickstart
51. The War Plugin
52. The Ear Plugin
53. The Jetty Plugin
54. The Application Plugin
55. The Java Library Distribution Plugin
56. Groovy Quickstart
57. The Groovy Plugin
58. The Scala Plugin
59. The ANTLR Plugin
60. The Checkstyle Plugin
61. The CodeNarc Plugin
62. The FindBugs Plugin
63. The JDepend Plugin
64. The PMD Plugin
65. The JaCoCo Plugin
66. The OSGi Plugin
67. The Eclipse Plugins
68. The IDEA Plugin
VI. The Software model
69. Rule based model configuration
70. Software model concepts
71. Implementing model rules in a plugin
72. Building Java Libraries
73. Building Play applications
74. Building native software
75. Extending the software model
VII. Appendix
A. Gradle Samples
B. Potential Traps
C. The Feature Lifecycle
D. Gradle Command Line
E. Documentation licenses
List of Examples
4.1. Executing multiple tasks
4.2. Excluding tasks
4.3. Abbreviated task name
4.4. Abbreviated camel case task name
4.5. Selecting the project using a build file
4.6. Selecting the project using project directory
4.7. Forcing tasks to run
4.8. Obtaining information about projects
4.9. Providing a description for a project
4.10. Obtaining information about tasks
4.11. Changing the content of the task report
4.12. Obtaining more information about tasks
4.13. Obtaining detailed help for tasks
4.14. Obtaining information about dependencies
4.15. Filtering dependency report by configuration
4.16. Getting the insight into a particular dependency
4.17. Information about properties
6.1. Running the Wrapper task
6.2. Wrapper task
6.3. Wrapper generated files
6.4. Specifying the HTTP Basic Authentication credentials using system properties
6.5. Specifying the HTTP Basic Authentication credentials in distributionUrl
6.6. Configuring SHA-256 checksum verification
8.1. Declaring dependencies
8.2. Definition of an external dependency
8.3. Shortcut definition of an external dependency
8.4. Usage of Maven central repository
8.5. Usage of JCenter repository
8.6. Usage of a remote Maven repository
8.7. Usage of a remote Ivy directory
8.8. Usage of a local Ivy directory
8.9. Publishing to an Ivy repository
8.10. Publishing to a Maven repository
9.1. Listing the projects in a build
11.1. Dependencies of my-app
11.2. Declaring a command-line composite
11.3. Declaring a separate composite
11.4. Depending on task from included build
11.5. Build that does not declare group attribute
11.6. Declaring the substitutions for an included build
11.7. Depending on a single task from an included build
11.8. Depending on a tasks with path in all included builds
12.1. Setting properties with a gradle.properties file
12.2. Configuring an HTTP proxy
12.3. Configuring an HTTPS proxy
14.1. Using the tooling API
15.1. Configure the local cache
15.2. Pull from HttpBuildCache
15.3. Configure remote HTTP cache