# JettyRun task jvm args to enable remote debugging

**URL:** <https://discuss.gradle.org/t/jettyrun-task-jvm-args-to-enable-remote-debugging/4656>\
**Category:** Old Forum Archive\
**Created:** [March 3, 2013, 12:17am UTC](https://discuss.gradle.org/t/jettyrun-task-jvm-args-to-enable-remote-debugging/4656 "2013-03-03T00:17:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim\_Hinnerk\_Heuer](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/tim_hinnerk_heuer/32/897_2.png) [@Tim\_Hinnerk\_Heuer](https://discuss.gradle.org/u/Tim_Hinnerk_Heuer)\
**Post date:** [March 3, 2013, 12:17am UTC](https://discuss.gradle.org/t/jettyrun-task-jvm-args-to-enable-remote-debugging/4656/1 "2013-03-03T00:17:00Z")

</div>

How do I enable a JettyRun task and pass it custom jvm args to enable remote debugging in my IDE?

I know the jvm args but could only pass them to other task types.

---

<div class="post-metadata">

**Author:** ![djangofan](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/djangofan/32/117_2.png) [@djangofan](https://discuss.gradle.org/u/djangofan)\
**Post date:** [March 3, 2013, 6:10pm UTC](https://discuss.gradle.org/t/jettyrun-task-jvm-args-to-enable-remote-debugging/4656/2 "2013-03-03T18:10:00Z")

</div>

From GRADLE bug #1804, some ideas:

‘◾Just edit the .gradle file to change the content of the args parameter. Bad because it adds noise to the version control. ◾Read a file with the arguments, parse it, and feed args with them. You need to know Groovy to do so, and it is tricky to handle the OS conventions: Windows accepts only double quotes, Unix-based systems are more flexible, etc. ◾Use -Pfoo=bar. Limited. ◾Use tasks.addRule and extract the arg from the task name. Too hackish and limited.’

---

<div class="post-metadata">

**Author:** ![djangofan](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/djangofan/32/117_2.png) [@djangofan](https://discuss.gradle.org/u/djangofan)\
**Post date:** [March 3, 2013, 6:22pm UTC](https://discuss.gradle.org/t/jettyrun-task-jvm-args-to-enable-remote-debugging/4656/3 "2013-03-03T18:22:00Z")

</div>

I have not tried it, but it seems like you could do something like this:

```gradle
tasks.withType(Test) {
    jvmArgs '-Xms128m', '-Xmx1024m', '-XX:MaxPermSize=128m', '-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044'
    maxParallelForks = 8
    testLogging {
        exceptionFormat "full"
        events "started", "passed", "skipped", "failed", "standardOut", "standardError"
        displayGranularity = 0
    }
}

```

Or perhaps something more like this?

```gradle
tasks.withType(Jetty) {
    jvmArgs '-Xms128m', '-Xmx1024m', '-XX:MaxPermSize=128m', '-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044'
}

```
