Jonas Geiregat
Jonas Geiregat

Reputation: 5432

Set debug JVM args on specific gradle task

I've got the following gradle (version 2.3) task defined

task local {
    tasks.withType(org.springframework.boot.gradle.run.BootRunTask) {
        systemProperty('spring.profiles.active', 'local')
    }
    applicationDefaultJvmArgs = [
            "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
    ]
}

I'm trying to start a spring boot application with debugging enabled.

For some reason this does not work from inside the local task:

> No such property: applicationDefaultJvmArgs for class: org.gradle.api.DefaultTask_Decorated 

Upvotes: 1

Views: 1818

Answers (1)

Jolta
Jolta

Reputation: 2715

applicationDefaultJvmArgs is a property of the 'application' plugin. That plugin was probably not applied in your project, so the property does not exist in your local task.

Upvotes: 2

Related Questions