Probably what's happening is Maven is launching a second JVM to run your tests.
If so, you can use -DargLine="=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=4657" to pass those arguments to the launched JVM. Alternately, you can set surefire to forkMode=never and then your MAVEN_OPTS trick will work just fine. -Dan > -----Original Message----- > From: matthewadams [mailto:[EMAIL PROTECTED] > Sent: Monday, October 23, 2006 3:46 PM > To: users@maven.apache.org > Subject: [M2] FAQ? Debugging unit tests in Maven2 > > > Hi, > > This seems to be a FAQ, and searches on this list seem not to yield > definitive answers. I have a plain old Maven2 project whose unit tests > I'd > like to debug using an IDE. I've tried launching Maven2 with debug > options > set, but I never hit any breakpoints that I've set after attaching the > debugger. Here's my handy dandy mvnd.bat file, to make things a bit > easier: > > setlocal > set MAVEN_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE > -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=4657 > call mvn.bat test > > Maven gets launched and waits for the debugger to attach on port 4657. > The > debugger attaches just fine, then the tests get run and my breeakpoints > never get hit. > > What do I have to do to get my breakpoints to work? Please help! > > --matthew > > PS: Once I get this question resolved, the next one has to do with > debugging my Maven2 plugin, which is used in this plain old Maven2 > project! > -- > View this message in context: http://www.nabble.com/-M2--FAQ---Debugging- > unit-tests-in-Maven2-tf2498076.html#a6963756 > Sent from the Maven - Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] _______________________________________________________________________ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]