Debugging gradle applications on Netbeans

I can launch my application by executing it directly using the Netbeans launch command, but the application just launches and no debugging information is displayed / written.

In addition, I need to pass some arguments to the main method, because I use Dropwizard.

How can I debug my application in Netbeans?

+7
debugging netbeans gradle dropwizard
source share
1 answer

In build.gradle I created the following task:

 task(debug, dependsOn: 'classes', type: JavaExec) { main = 'com.example.MyMainClass' classpath = sourceSets.main.runtimeClasspath args 'server', 'my-application.yml' debug true } 

Netbeans launches the application and automatically connects to the debug port and starts debugging.

The string 'args' contains the arguments passed to the main method required by Dropwizard.

Based on this article .

+9
source share

All Articles