Now days Gradle is picking the market in build tools space.

Gradle has combined features from other build tools under one roof such as chaining of targets from Apache ant,Multimodule projects and convention over configuration from Apache maven, Dependency management from Ivy and Groovy DSL on top of gant.

Today we will learn build process with existing code and common problems.

There is big problem when someone checkout the code from repository and try to build the project without knowing version of gradle has been used in the project.
When the local installed gradle version if different and the gradle used in project is different then build failure is common problem due to version mismatch.

Gradle provides a very convenient and practical solution to this problemGradle wrapper.The wrapper is a core feature and enables a machine to run a Gradle build script without having to install the runtime. It also ensures that the build script is run with a specific version of Gradle.

It does so by automatically downloading the Gradle runtime from a central location, unpacking it to your local file system, and using it for the build and Following piece of code is does this.

You can find this folder in root folder of the project which contains instructions to download

│    └── wrapper 
|           ── gradle-wrapper.jar
|           └──

The above folder is created by the follwing task by gradle.


task wrapper(type: Wrapper) {
gradleVersion = '1.7'

By Executing following gradle command wrapper will generate the wrapper files with the current version of your Gradle runtime:
$ gradle wrapper

Bottom Line is
if you have stucked with some maven2 model mapping exception either use gradlew command which download gradle and build project no need to worry about gradle version or use same version mentioned in gradle wrapper task.

Hope this Help.