You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Paul Sterk <Pa...@Sun.COM> on 2007/10/04 20:15:04 UTC

Debugging maven 2 with Netbeans

Hi,

I want to run 'mvn test' and have maven open a jdwp listener so that I
can debug a plugin unit test.  I thought I found the answer:

export MAVEN_OPTS="-Xdebug
-Xrunjdwp:transport=dt_socket,address=9009,server=y,suspend=y"

I then ran 'mvn test' and connected to port 9009 with Netbeans 5.5.1.
One problem: none of my breakpoints were hit.  Why is that?  More info
on my env:

Maven version: 2.0.7
Java version: 1.6.0_02
OS name: "linux" version: "2.6.20-15-generic" arch: "amd64"

Surely, someone has found a way to debug maven plugins using an IDE.
Please tell me how.

Thanks,
Paul

Re: Debugging maven 2 with Netbeans

Posted by Tim Kettler <ti...@udo.edu>.
Hi,

the surefire-plugin defaults to fork a new jvm for running the tests. 
You either have to specify the debug options in the <argLine/> parameter 
of the plugin configuration or disable the forking.

-Tim

Paul Sterk schrieb:
> Hi,
> 
> I want to run 'mvn test' and have maven open a jdwp listener so that I
> can debug a plugin unit test.  I thought I found the answer:
> 
> export MAVEN_OPTS="-Xdebug
> -Xrunjdwp:transport=dt_socket,address=9009,server=y,suspend=y"
> 
> I then ran 'mvn test' and connected to port 9009 with Netbeans 5.5.1.
> One problem: none of my breakpoints were hit.  Why is that?  More info
> on my env:
> 
> Maven version: 2.0.7
> Java version: 1.6.0_02
> OS name: "linux" version: "2.6.20-15-generic" arch: "amd64"
> 
> Surely, someone has found a way to debug maven plugins using an IDE.
> Please tell me how.
> 
> Thanks,
> Paul
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Debugging maven 2 with Netbeans

Posted by Milos Kleint <mk...@gmail.com>.
it should be enough to open ant-run-plugin project sources in the IDE,
place the breakpoints in the test and execute the "Debug file" action
on the test file.
With the approach you have taken, it's possible to debug maven
internals, however the test is probably executed in yet another VM
which is not in debug mode.

Milos Kleint

On 10/4/07, Paul Sterk <Pa...@sun.com> wrote:
>
> Hi,
>
> I want to run 'mvn test' and have maven open a jdwp listener so that I
> can debug a plugin unit test.  I thought I found the answer:
>
> export MAVEN_OPTS="-Xdebug
> -Xrunjdwp:transport=dt_socket,address=9009,server=y,suspend=y"
>
> I then ran 'mvn test' and connected to port 9009 with Netbeans 5.5.1.
> One problem: none of my breakpoints were hit.  Why is that?  More info
> on my env:
>
> Maven version: 2.0.7
> Java version: 1.6.0_02
> OS name: "linux" version: "2.6.20-15-generic" arch: "amd64"
>
> Surely, someone has found a way to debug maven plugins using an IDE.
> Please tell me how.
>
> Thanks,
> Paul
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org