Debugging jenkins using eclipse

I created a new Hello World plugin for Jenkins and I was able to download it to Jenkins and it works successfully. Now I'm trying to make changes to the plugin and debug it on Jenkins. I did this according to the instructions in this lesson https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial

I tried this command:

mvnDebug hpi:run 

and then start debugging from eclipse to port 8000, which is the port that Jenkins opens for debugging. Eclipse was able to connect to the correct port, and I received a message that seems correct:

 [info] Jenkins is fully up and running 

Everything seems to have gone well. Then I go to localhost: 8080 to see the plugin, but found nothing there. Can someone help me with this please? Thanks.

+7
source share
1 answer

Well, about debugging Jenkins plugins, I know that there is some information. I can tell you how I am debugging:

Using the tutorial from https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial#Plugintutorial-DebuggingaPlugin 1. Stop the Jenkins service 2. from cmd run set MAVEN_OPTS = -Xdebug -Xrunjdwp: transport = dt_socket, server y, address = 8000, suspend = n and also mvn hpi: run Note. Auto build must be disabled in Eclipse. And after running mvn hpi: run I am trying to connect Eclipse to a port using java remote (or something like this).

The second method I use: 1. I installed the maven plugin in eclipse 2. Create a startup configuration as maven in eclipse 3. Stop the jenkins server 4. Run the configuration 5. Access to localhost: 8080 / jenkins

Sorry for not giving the exact steps, but I have these configurations on my PC at work ...

In addition, in my opinion, the second method is more stable. I often use it when I work with my plugin ...

+2
source

All Articles