Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-29299

how to debug a Jenkins plugin when Jenkins is started through "gradle server"

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • gradle-jpi-plugin
    • None

      I haven't seen it documented anywhere...
      I use Gradle to build my sample Jenkins Plugin (thanks a lot for implementing it, by the way!).

      now I want to debug the plugin in Intellij IDEA. I start the server using "gradle server" command , which launches Jenkins with my plugin installed. now, how do I -
      1) connect to that process and make IDEA stop at breakpoints?
      2) when I recompile, I would want to see the new behavior right away without restarting the server, if possible

          [JENKINS-29299] how to debug a Jenkins plugin when Jenkins is started through "gradle server"

          Starting the "server" tasks in a debug configuration from IDEA does not work, breakpoints are not triggered. Probably a bug in IDEA.

          But starting the task from the command line with debug options and then attaching a remote debugger works.

          >set GRADLE_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
          >gradlew server
          

          Daniel Spilker added a comment - Starting the "server" tasks in a debug configuration from IDEA does not work, breakpoints are not triggered. Probably a bug in IDEA. But starting the task from the command line with debug options and then attaching a remote debugger works. >set GRADLE_OPTS= "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005" >gradlew server

          I updated the wiki page and the README.

          Daniel Spilker added a comment - I updated the wiki page and the README .

          Alex Java added a comment -

          great, thank you!

          Alex Java added a comment - great, thank you!

            daspilker Daniel Spilker
            alskor Alex Java
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: