简体   繁体   中英

How to force NetBeans 11.2 to use gradle wrapper packaged in project

i'm fighting with NetBeans for a few days. I have to work on a project that is build with gradle, the Project comes with an gradle Wrapper. When i try to build the Project from command line, everything works fine, i just run ./gradlew build in my projects root directory. When i try to build the project within NetBeans, my IDE is using it's own gradle installation which is located in my user directory, but it has the wrong version. The checkbox "Prefer to use Gradle Wrapper that Comes with the Project" is ticked. If i try to change my gradle settings in my IDE, NetBeans got Stuck within a Dialog which says that there is a long operation in progress and i have to kill the NetBeans process.

I'm Using tht following tools to build my Project: Windows 10 (sadly), NetBeans 11.2 and Oracle JDK 1.8.0_231.

NetBeans gave me the following command line output:

JAVA_HOME="C:\Program Files\Java\jdk1.8.0_231"
cd D:\repos\project\app; C:\Users\username\.gradle\wrapper\dists\gradle-4.10.2-bin\cghg6c4gf4vkiutgsab8yrnwv\gradle-4.10.2\bin\gradle --configure-on-demand clean build
Parallel execution with configuration on demand is an incubating feature.

FAILURE: Build failed with an exception.

* Where:
Script 'D:\repos\project\app\build.gradle' line: 1

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
   > Minimum supported Gradle version is 5.4.1. Current version is 4.10.2. If using the gradle wrapper, try editing the distributionUrl in C:\Program Files\NetBeans-11.2\gradle\wrapper\gradle-wrapper.properties to gradle-5.4.1-all.zip

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s

There are no special configs made in the build.gradle or gradle.properties.

Has someone an idea how to force NetBeans to use the packaged gradle?

Thanks for response!

i figured out what was happening. NetBeans seems to search for an gradlew.bat in the project root, if there is none, NetBeans is going to try it's own gradle version. Interesting is, when there is a gradlew.bat NetBeans still uses the shell script gradlew without any extension.

Greetings

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