Add-on debug

38 views
Skip to first unread message

Nick

unread,
Apr 7, 2025, 4:56:20 AMApr 7
to ZAP Developer Group
Hello,
I was wondering if it's possible to test an add-on by putting breackpoints, I would use the deploy in intelliJ, and eventually how to do it
Best regards

psiinon

unread,
Apr 7, 2025, 5:29:39 AMApr 7
to ZAP Developer Group
It is, yes.
It should be similar for IntelliJ - if you work it out could you update these docs? :) https://www.zaproxy.org/docs/developer/building-zap-with-intellij-idea/

Cheers,

Simon

Nick

unread,
Apr 7, 2025, 6:15:47 AMApr 7
to ZAP Developer Group
Ok thank I will try, but now I'm trying to load my code in the zap-extensions folder, so then I can put breackpoints, and it fails the JavaCompile for the -Werror flag, I know the plugin works if as a standalone project, do you know how I can fix it?

psiinon

unread,
Apr 7, 2025, 6:38:55 AMApr 7
to ZAP Developer Group
No, I am not telepahic, or omnipresent :D

Maybe if you shared the error messages...?

Nick

unread,
Apr 7, 2025, 8:47:55 AMApr 7
to ZAP Developer Group
Sorry,
I never encountered this kind of message so I assumed it had to be related to something specific of ZAP, my bad, I will list you the errors during the copyzapaddon task:
error: warnings found and -Werror specified


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':addOns:migt:compileJava'.
> Compilation failed; see the compiler output below.
  C:\Users\Utente\Desktop\ZAP IntelliJ\zap-extensions\addOns\migt\src\main\java\org\zaproxy\addon\migt\ParsingException.java:4: warning: [serial] serializable class ParsingException has no definition of serialVersionUID
  public class ParsingException extends Exception {
         ^
  1 error
  11 warnings

* Try:
> Run with --scan to get full insights.

It seems to found some warnings, and because of them it stop and returns an error. When compiling the project standalone I don't have any problems and the addon loads and work.
Regards

Nick

unread,
Apr 7, 2025, 10:39:56 AMApr 7
to ZAP Developer Group
This are the warnings, I just noticed that they were missing: 
public class ParsingException extends Exception {
       ^
error: warnings found and -Werror specified
error: warnings found and -Werror specified

 [static] static variable should be qualified by type name, ExecuteWebServer, instead of by an expression
        this.mainPane = mainPane;
            ^
           JTextArea t = (JTextArea) sessions_text.get(session_name);
                          ^
serializable class declared with a non-serializable type
    Map<String, JTextArea> sessions_text;
                           ^
definition of serialVersionUID
public class ReqResPanel extends JPanel {
       ^
serializable class declared with a non-serializable type
    private HTTPReqRes displayedMsg;
                       ^
[deprecation] Observable in java.util has been deprecated
public class CertificateTabController extends Observable {
                                              ^
[deprecation] Observable in java.util has been deprecated
public class CertificateTabController extends Observable {
                                              ^
[deprecation] Observable in java.util has been deprecated
public class CertificateTabController extends Observable {
                                              ^
[deprecation] Observable in java.util has been deprecated
public class CertificateTabController extends Observable {
                                              ^
[deprecation] Observable in java.util has been deprecated
public class CertificateTabController extends Observable {
                                              ^

Nick

unread,
Apr 10, 2025, 2:49:29 AMApr 10
to ZAP Developer Group
I was able to resolve the issue with the warnings and to deploy the addon on IntelliJ, I will update if I'm able to enter debug mode.
Regards

psiinon

unread,
Apr 10, 2025, 3:59:37 AMApr 10
to ZAP Developer Group
Thanks for letting us know!
Reply all
Reply to author
Forward
0 new messages