Skip to main content

Posts

Showing posts from February, 2012

debug maven test in eclipse using surefire plugin

Some time debugging test cases in eclipse will give "206" error, that classpath string length is exceeding the character limit, due to more libraries in classapth. In this case we can't debug our test cases in eclipse. To solve this problem, maven-surefire-plugin has already given below solution: http://maven.apache.org/plugins/maven-surefire-plugin/examples/debugging.html Debugging Tests Sometimes you need to debug the tests exactly as Maven ran them. Here's how! Forked Tests By default, Maven runs your tests in a separate ("forked") process. You can use the   maven.surefire.debug   property to debug your forked tests remotely, like this: mvn - Dmaven . surefire . debug test The tests will automatically pause and await a remote debugger on port 5005. You can then attach to the running tests using Eclipse. You can setup a "Remote Java Application" launch configuration via the menu command "Run" > "Open Debug Dialog..