Gradle User Guide
Version 3.3
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 Wrapper
6. The Gradle Daemon
7. Dependency Management Basics
8. Introduction to multi-project builds
9. Continuous build
10. Composite builds
11. Using the Gradle Graphical User Interface
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. Initialization Scripts
45. The Gradle TestKit
V. BUILDING JVM PROJECTS
46. Java Quickstart
47. The Java Plugin
48. Web Application Quickstart
49. The War Plugin
50. The Ear Plugin
51. The Jetty Plugin
52. The Application Plugin
53. The Java Library Distribution Plugin
54. Groovy Quickstart
55. The Groovy Plugin
56. The Scala Plugin
57. The ANTLR Plugin
58. The Checkstyle Plugin
59. The CodeNarc Plugin
60. The FindBugs Plugin
61. The JDepend Plugin
62. The PMD Plugin
63. The JaCoCo Plugin
64. The OSGi Plugin
65. The Eclipse Plugins
66. The IDEA Plugin
VI. THE SOFTWARE MODEL
67. Rule based model configuration
68. Software model concepts
69. Implementing model rules in a plugin
70. Building Java Libraries
71. Building Play applications
72. Building native software
73. Extending the software model
VII. APPENDIX
A. Gradle Samples
B. Potential Traps
C. The Feature Lifecycle
D. Gradle Command Line
E. Documentation licenses
Glossary
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
5.1. Running the Wrapper task
5.2. Wrapper task
5.3. Wrapper generated files
5.4. Specifying the HTTP Basic Authentication credentials using system properties
5.5. Specifying the HTTP Basic Authentication credentials in distributionUrl
5.6. Generating a SHA-256 hash
5.7. Configuring SHA-256 checksum verification
7.1. Declaring dependencies
7.2. Definition of an external dependency
7.3. Shortcut definition of an external dependency
7.4. Usage of Maven central repository
7.5. Usage of JCenter repository
7.6. Usage of a remote Maven repository
7.7. Usage of a remote Ivy directory
7.8. Usage of a local Ivy directory
7.9. Publishing to an Ivy repository
7.10. Publishing to a Maven repository
8.1. Listing the projects in a build
10.1. Dependencies of my-app
10.2. Declaring a command-line composite
10.3. Declaring a separate composite
10.4. Depending on task from included build
10.5. Build that does not declare group attribute
10.6. Declaring the substitutions for an included build
10.7. Depending on a single task from an included build
10.8. Depending on a tasks with path in all included builds
11.1. Launching the GUI
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
16.1. Your first build script
16.2. Execution of a build script
16.3. A task definition shortcut
16.4. Using Groovy in Gradle's tasks
16.5. Using Groovy in Gradle's tasks
16.6. Declaration of task that depends on other task
16.7. Lazy dependsOn - the other task does not exist (yet)
16.8. Dynamic creation of a task
16.9. Accessing a task via API - adding a dependency
16.10. Accessing a task via API - adding behaviour
16.11. Accessing task as a property of the build script