Debug Jenkins core using NetBeans

320 views
Skip to first unread message

Daniel Olausson

unread,
Feb 5, 2013, 8:32:56 AM2/5/13
to jenkin...@googlegroups.com
Hi,

I want to use NetBeans and put break points in Jenkins and then debug it. For example if I put a break point in a 
listener and then push a button on the Jenkins web I can step forward and see what's really happening.

Anyone know how this can be done?

Jesse Glick

unread,
Feb 5, 2013, 1:30:45 PM2/5/13
to jenkin...@googlegroups.com
Open (at least) the core and war modules, running a “priming build” if requested. Set your breakpoints. Then select the war module and hit Debug Project. When Jenkins
starts, browse http://localhost:8080/ and do what you need to do. That is all.

Daniel Olausson

unread,
Feb 6, 2013, 3:24:05 AM2/6/13
to jenkin...@googlegroups.com
Thank you very much :) If I have a plugin, is there any way that i can debug the whole thing together or do I have to install my plugin manually when i debug jenkins core? And if I want to set breakpoints in my own plugin I can just press debug on my plugin in NetBeans?

Jesse Glick

unread,
Feb 6, 2013, 1:18:14 PM2/6/13
to jenkin...@googlegroups.com
On 02/06/2013 03:24 AM, Daniel Olausson wrote:
> if I want to set breakpoints in my own plugin I can just press debug on my plugin in NetBeans?

Yup, that is all you need—your baseline Jenkins version will be started with your plugin loaded, and you can use the debugger on your plugin classes, including Apply Code
Changes. (No need to do anything special to reload resources like *.jelly: just save them and reload the page in the browser.)

(You can also have breakpoints in Jenkins core when debugging the plugin.)

Oleg Nenashev

unread,
Jan 2, 2014, 4:14:35 PM1/2/14
to jenkin...@googlegroups.com
Just an update for other Google users,

The one-click debug has been explicitly disabled in Netbeans 7.3.
Below you can find a comment from Jesse:
Yes, I disabled this explicitly in Jenkins sources since I have run into problems with it, though when it works it is certainly convenient. Vote for #227791 if you like.

Source: https://github.com/jenkinsci/jenkins/pull/1082#issuecomment-31483990

Best regards,
Oleg Nenashev

среда, 6 февраля 2013 г., 22:18:14 UTC+4 пользователь Jesse Glick написал:

Jesse Glick

unread,
Jan 2, 2014, 4:41:28 PM1/2/14
to jenkin...@googlegroups.com
On Thu, Jan 2, 2014 at 4:14 PM, Oleg Nenashev <o.v.ne...@gmail.com> wrote:
> The one-click debug has been explicitly disabled in Netbeans 7.3.

Not at all, Debug Project on a plugin works fine. What has been
disabled (in Jenkins sources, not for any particular IDE version) is
compile-on-save mode (CoS) for tests in the Jenkins core repository:
you should explicitly Build Project on the ‘core’ module before
running a functional test in the ‘test’ module, which is slower (forks
Maven) but reliable. Tests in plugins are still run using CoS.
Reply all
Reply to author
Forward
0 new messages