Skip to content

Commit

Permalink
chore(build): add debug flag to rosco build (#236)
Browse files Browse the repository at this point in the history
Starting rosco with ./gradlew -DDEBUG=true now causes the JVM to
listen for a remote debugger on port 8187.
  • Loading branch information
ezimanyi committed Mar 3, 2018
1 parent 266bf0d commit 8a7f60f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ docker run -it --link redis:redis --rm redis redis-cli -h redis -p 6379
./gradlew bootRun
```

### Debugging

To start the JVM in debug mode, set the Java system property `DEBUG=true`:
```
./gradlew -DDEBUG=true
```

The JVM will then listen for a debugger to be attached on port 8187. The JVM will _not_ wait for the debugger
to be attached before starting Rosco; the relevant JVM arguments can be seen and modified as needed in `build.gradle`.

## Verifying
```
curl -v localhost:8087/bakeOptions
Expand Down
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ allprojects {
exceptionFormat = 'full'
}
}
tasks.withType(JavaExec) {
if (System.getProperty('DEBUG', 'false') == 'true') {
jvmArgs '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8187'
}
}
}

defaultTasks ':rosco-web:bootRun'

0 comments on commit 8a7f60f

Please sign in to comment.