Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jenkins debugging with eclipse

Tags:

jenkins

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.

like image 259
esdotzed Avatar asked May 31 '13 17:05

esdotzed


People also ask

Can we integrate Jenkins with Eclipse?

Jenkins is a continuous integration (CI) server. It is in use on Eclipse servers for Eclipse projects as part of the Common Build Infrastructure (CBI). This page is about the hosted service at Eclipse.org. For more information on the project itself, or to download Jenkins, please see the Jenkins project page.

Can we debug in Jenkins?

Being able to debug a Jenkins plugins is a valuable addition to your development skills—it can help you understand what is going on with your own plugin while you are developing it, and it can also help you to resolve issues in other plugins or Jenkins itself.

How do I run a Jenkins file in Eclipse?

Next, in you Eclipse IDE, go to Window ---> Show View ---> Other ---> Mylyn ---> Builds Select Builds and click Open. You will now see a Build page in your Eclipse IDE. Just go ahead and click on "Create a new build server". A new window will pop up, select Hudson(supports Jenkins) and click Next.


1 Answers

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...

like image 86
23ars Avatar answered Oct 07 '22 10:10

23ars