Intellij IDEA debugger not working on Gradle Vert.X project

后端 未结 2 603
囚心锁ツ
囚心锁ツ 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.

    0 讨论(0)
  • 2021-01-01 04:01

    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
        ]
    }
    
    0 讨论(0)
提交回复
热议问题