简体   繁体   中英

Gradle Wrapper not responding to commands

On my Linux machine in my root project directory I have the Gradle Wrapper

Project
 |
 + src
 |
 + gradlew

and when I run any command with gradlew there is no output, like for example when I print the version, there is no version printed

./gradlew --version

or when I check tasks, no tasks are displayed

./gradlew --tasks

or when I try to build the project, no out/ directory is created

./gradlew deploy

but when I click

Build > Build Project

in my Intellij IDE, the project does build, just not when I try to use Gradle from the command line.

So I have no idea what's going on with my gradle wrapper. Am I using the wrapper incorrectly?

My gradle wrapper which is just a Bash script, was empty ... somehow it's contents were deleted, so the script was running and nothing was happening. Good times.

It happened to me as well, the script was totally empty. The fix for me was to go to the gradle tab in IntelliJ and click on "Wrapper" under "Build setup". After this my gradlew script got properly initialized.

看图片

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM