Can I debug Maven builds (mojo code) from the IDE?

Yes. The following steps were tested with a NB 7.0 development build but ought to apply to earlier releases as well.

I made a "Java Application" and added


In the properties dialog of the demo project, I added a custom action to run a sample mojo while debugging the build, so that my nbactions.xml looks like this:

<?xml version="1.0" encoding="UTF-8"?>
        <displayName>Debug Mojo</displayName>

(You can also run the same goals without creating a custom action, if you don't mind retyping the above information each time.) As expected (given that I have configured nothing related to JNLP in this project), it fails with a stack trace:

        at org.codehaus.mojo.webstart.AbstractJnlpMojo.execute(AbstractJnlpMojo.java:214)

If I check out https://svn.codehaus.org/mojo/tags/webstart-1.0-beta-1/webstart-maven-plugin and open it in the IDE, and set a breakpoint on that line, then when running the custom action the debugger stops at that line and shows me that jnlp = null.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo