Gradle: custom task with jvm arguments for Spring Boot

Viewed 1456

Trying to create a small custom gradle task for Spring Boot that originally looks like this:

gradle bootRun --debug-jvm

The task should look like this: gradle debugRun

I tried this but it does not work:

task debugRun(dependsOn: 'bootRun') << {
    applicationDefaultJvmArgs = ['--debug-jvm']
}

How can I pass this debug-flag to the bootRun task?

1 Answers
Related