Friday, March 2, 2018

How to create a wrapper in gradle?

Make sure that the build.gradle has the "wrapper" task as below:

task wrapper(type: Wrapper) {
     gradleVersion = '4.6'
}
Run the "gradle wrapper" from the command line, it would create the gradle wrappers.

After that you can push those files to source control so that,no manual steps is required later.


Commands are given below:

$ gradle wrapper
$ git add gradlew gradlew.bat gradle
$ git commit -m "Adding gradle wrapper to git repo"
$ git push

So all the future builds can be using gradlew

$ ./gradlew build
:framework:compileJava
:framework:processResources
:framework:classes
:framework:jar
:compileJava
:processResources
:classes
:findMainClass
:jar
:bootRepackage
:assemble
:compileTestJava
:processTestResources UP-TO-DATE
:testClasses
:test
:check
:build
:framework:findMainClass
:framework:bootRepackage
:framework:assemble
:framework:compileTestJava
:framework:processTestResources UP-TO-DATE
:framework:testClasses
:framework:test
:framework:check
:framework:build
BUILD SUCCESSFUL
Total time: 42.712 secs

Resource Link:
==============
https://stackoverflow.com/questions/42675234/spring-boot-1-3-3-is-not-building-with-gradle-3-0

No comments:

Post a Comment