简体   繁体   中英

How to debug a Gradle project with jvm args in Netbeans?

I created a Gradle project in NetBeans (8.0.2), which uses database connections from my tnsnames.ora. So I added the line

applicationDefaultJvmArgs = ["-Doracle.net.tns_admin=${System.env.TNS_ADMIN}"]

to my build.gradle. (I use the java and application plugins)

This works when I run the project, but not for debugging. It looks like this setting is simply not used in debug mode.

How can I get this to run? Either in the build.gradle or in the NetBeans settings would be fine.

Here's how I got around this problem.

task(debug, dependsOn: 'classes', type: JavaExec)
{
    main = mainClass
    classpath = sourceSets.main.runtimeClasspath
    debug true
    jvmArgs = ["-DmyProperty=myValue"]
}

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