How to debug a gerrit plugin with eclipse?

533 views
Skip to first unread message

Paladin Wonder

unread,
May 22, 2014, 4:58:06 AM5/22/14
to repo-d...@googlegroups.com
I am a beginner of gerrit developer, 
I've setup a gerrit server in my localhost, and install my plugin on it, but it seems doesn't work.
How can I get the log or debug it with eclipse? 
That's what I have done:
1, installed maven tools to eclipse and compile&package success
2, add configuration in ./etc/gerrit.config:   
    container.javaOptions = -Xdebug -Xrunjdwp:transport=dt_socket,address=8998,server=y,suspend=n

Please help me with more informaiton, Thanks

Dariusz Luksza

unread,
May 22, 2014, 5:21:06 AM5/22/14
to Paladin Wonder, repo-discuss
This article[1] should help you. You are only missing last part which
is adding a 'remote debug' configuration to eclipse.

[1] http://javarevisited.blogspot.de/2011/02/how-to-setup-remote-debugging-in.html
> --
> --
> To unsubscribe, email repo-discuss...@googlegroups.com
> More info at http://groups.google.com/group/repo-discuss?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Repo and Gerrit Discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to repo-discuss...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Best regards

GSM: +49 017 445 41235
Blog: http://luksza.org http://javablog.pl
LinkedIn: http://linkedin.com/in/dariuszluksza

David Ostrovsky

unread,
May 22, 2014, 5:22:02 AM5/22/14
to repo-d...@googlegroups.com

Am Donnerstag, 22. Mai 2014 10:58:06 UTC+2 schrieb Paladin Wonder:
I am a beginner of gerrit developer, 
I've setup a gerrit server in my localhost, and install my plugin on it, but it seems doesn't work.


Is it loaded? Or what do you mean by doesn't work?

The easiest way would be to import Gerrit project in Eclipse, see [1] and [2].
Then you can just start Gerrit from Eclipse, put a breakpoint in your plugin
code, add path to source file(s) and it just works.


Paladin Wonder

unread,
May 22, 2014, 10:49:14 PM5/22/14
to repo-d...@googlegroups.com, Paladin Wonder
Thanks, I tried, the remote debug works!

在 2014年5月22日星期四UTC+8下午5时21分06秒,Dariusz Łuksza写道:

Paladin Wonder

unread,
May 22, 2014, 10:51:34 PM5/22/14
to repo-d...@googlegroups.com
What do you mean 'start Gerrit from Eclipse'?  Gerrit can be started by 'Run' action? If so, it sounds great

在 2014年5月22日星期四UTC+8下午5时22分02秒,David Ostrovsky写道:

David Ostrovsky

unread,
May 22, 2014, 11:10:17 PM5/22/14
to repo-d...@googlegroups.com

Am Freitag, 23. Mai 2014 04:51:34 UTC+2 schrieb Paladin Wonder:
What do you mean 'start Gerrit from Eclipse'?  Gerrit can be started by 'Run' action? If so, it sounds great


You want 'Debug' and not 'Run' action, yes. And not only that, Gerrit doesn't
need to be restarted for UI changes and other smalll changes, because Buck
is invoked from Eclipse too.
Reply all
Reply to author
Forward
0 new messages