简体   繁体   中英

How to run a single file in Netbeans with Gradle?

I ported our project to gradle.

Everything runs fine, also debug.

However, sometimes I'd like to start a specific main belonging to a given class, which is different from the mainClass specified in Gradle.

How can I achieve something like that without having to modify manually everytime build.gradle ?

Right click -> Run still executes the gradle mainClass ..

What version of NetBeans are you running? NetBeans 11.3 (with built-in Gradle support, not the external plugin), runs the selected file when you use the context menu as described. It appears to inject a "runSingle" task into the Gradle project to accomplish this.

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