Debugging 在Netbeans上调试gradle应用程序
我可以通过Netbeans run命令直接执行应用程序来运行应用程序,但应用程序只是运行,没有显示/捕获调试信息 另外,我需要将一些参数传递给main方法,因为我正在使用DropwizardDebugging 在Netbeans上调试gradle应用程序,debugging,netbeans,gradle,dropwizard,Debugging,Netbeans,Gradle,Dropwizard,我可以通过Netbeans run命令直接执行应用程序来运行应用程序,但应用程序只是运行,没有显示/捕获调试信息 另外,我需要将一些参数传递给main方法,因为我正在使用Dropwizard 如何在Netbeans上调试我的应用程序?我在build.gradle中创建了以下任务: task(debug, dependsOn: 'classes', type: JavaExec) { main = 'com.example.MyMainClass' classpath = sour
如何在Netbeans上调试我的应用程序?我在
build.gradle
中创建了以下任务:
task(debug, dependsOn: 'classes', type: JavaExec) {
main = 'com.example.MyMainClass'
classpath = sourceSets.main.runtimeClasspath
args 'server', 'my-application.yml'
debug true
}
Netbeans运行应用程序并自动连接到调试端口并开始调试
“args”行包含Dropwizard所需的传递给main方法的参数
基于.而不是显式设置JVM参数,您只需将任务上的
debug
属性设置为true
。建议不错,@MarkVieira。更清楚了。我更新了答案。谢谢对我来说,调试和使用Netbeans 8.0.2和Gradle 2.4运行一样有效。