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.
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.
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.
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.
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...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With