Gradle - Wrapper (gradlew)

About

Wrapper is a script that invokes a declared version of Gradle, downloading it beforehand if necessary. As a result:

  • developers can get up and running with a Gradle project quickly
  • and projects can have different gradle version

Example

Executing the build with the Wrapper batch file

gradlew.bat build

Model

<file>
├── build.gradle  
├── gradle
│   └── wrapper
│       ├── gradle-wrapper.jar  
│       └── gradle-wrapper.properties  
├── gradlew  
├── gradlew.bat  
└── settings.gradle  

where:

  • gradle-wrapper.jar is the Gradle Wrapper executable JAR
  • gradle-wrapper.properties is the Gradle Wrapper configuration properties

Management

Creation

gradle init

SCM / Git

The wrapper is part of the code in a version control repository

Upgrade

.\gradlew wrapper --gradle-version 7.5.1

Documentation





Discover More
Gradle - Single Project

A single-project has only the root project listed in the output of the gradle projects command, it's a multi-project ...
Gradle - Task

A build process execute a graph of tasks. Task may just be: container (lifecycle task) or provided by plugin In execution with the wrapper of the project Tasks themselves consist of:...
Gradle - Version

The gradle version may be different: by project with the than for the Each project should have wrapper to support versioning by project. or check the distribution url in the wrapper properties...



Share this page:
Follow us:
Task Runner