I have a pom.xml, which has following stuff declared
Plugins – maven-surefire-plugin, groovy-maven-plugin and maven-jar-plugin
Along with this couple of dependencies for the project and a couple of profiles.
When i run the following command from command line things move as per expectation
mvn clean install -P testProfile
but when i try to run the same command from Eclipse(for debugging purpose), maven runs fine(maven tries to resolve the dependencies but further processing is halted due to errors) but debug mode is not launched i.e. it does stop at my breakpoints specified.
but when i try to debug the same project as JUnit it does stop at those breakpoints.
Any idea what I am doing wrong, when using maven.
Well I have solved the problem.
When you use surefire plugin, it runs your tests in another forked process not in the current process, that’s why you are not able to debug your code.
If you want to debug your code, you need to make sure that surefire does not fork the tests. For this put the following setting in your maven configuration before launching the debug
This should do the job for you.
For more information visit surefire documentation page.