I\'m developing a project using Vert.X
framework using Gradle
build tool. The problem I have is that breakpoints in IntelliJ
simply do
Here are solutions to both issues. Thanks to @CrazyCoder for help on this.
1) run
command is run in separate VM. So, to make it work, I've added --java-opts
argument to the script:
run {
args = [
'run', mainVerticleName,
"-conf", confPath,
"--redeploy=$project.ext.watchForChange",
"--launcher-class=$mainClassName",
"--on-redeploy=$project.ext.doOnChange",
// used for attaching remote debugger
"--java-opts", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000"
]
}
This allows to attach Remote debug
configuration on port 8000
.
2) By default, Intellij IDEA
creates separate modules per source sets, so I had source sets for api_main
and api_test
modules. After turning off this feature - Application debug run started to work.
This can be turned off in Gradle Settings. Preferences -> Build, Execution, Deployment -> Build Tools -> Gradle
: uncheck create separate modules per source set.
This is an IntelliJ IDEA
issue - reference.
I had the exact same issue and following worked for me. redeploy, launcher and on-redeploy options are not necessary in intelliJ. if we remove those the debug works after application is up.
run {
args = [
'run', mainVerticleName,
"-conf", confPath
]
}