Intellij IDEA debugger not working on Gradle Vert.X project

后端 未结 2 620
囚心锁ツ
囚心锁ツ 2021-01-01 03:14

I\'m developing a project using Vert.X framework using Gradle build tool. The problem I have is that breakpoints in IntelliJ simply do

2条回答
  •  我在风中等你
    2021-01-01 04:00

    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.

提交回复
热议问题