esdotzed
esdotzed

Reputation: 508

jenkins debugging with eclipse

I have built a new "Hello World" plugin for Jenkins and I was able to upload it onto Jenkins and it works successfully. I am now trying to make change to the plugin and debug it on Jenkins. I did this according to the instructions on this tutorial https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial

I tried this command:

mvnDebug hpi:run

and then start to debug from eclipse to the port 8000 which is the port that Jenkins opens up for debugging. The eclipse was able to connect to the correct port and I got the message which seems to be correct:

[info] Jenkins is fully up and running

It seems that everything went OK. Then I go to localhost:8080 to see the plugin but I found nothing there. Can anybody help me with this, please? Thanks.

Upvotes: 8

Views: 5488

Answers (1)

23ars
23ars

Reputation: 648

Ok, about debugging Jenkins plugins, I know that there is a little amount of information. I can tell you how I debug:

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

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

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

Also, in my opinion the second method is more stable. I use it frequently when I work with my plugin...

Upvotes: 2

Related Questions