Dealing with Eclipse-based IDE
Table of Contents
- Introduction
- Openning your Maven Project in Eclipse
- Running your Maven Project in Eclipse
- Debugging your Maven Project in Eclipse
- Generic Debugging
- Surefire Debugging
Introduction
TODO
Openning your Maven Project in Eclipse
TODO
Running your Maven Project in Eclipse
TODO
Debugging your Maven Project in Eclipse
Note that there two debug modes in maven: the Generic, and the Surefire. If you want to debug maven itself, or a maven project of yours, use the Generic Approach. If you want to debug a test in your maven project launched by surefire, use the Surefire Approach.
Generic Debugging
- Setting up Maven
- Open
%M2_HOME%/bin/mvn.bat - At line 30, you'll find this,
. Delete
@REM(Thus, uncommenting that line) - Save that file as
mvn-dbg.bat(or any convinient name you may want). You now have to maven batch files, one for normal use, and one for debugging. - Run your maven command but use
mvn-dbginstead ofmvn(i.e. instead ofmvn install, usemvn-dbg install)
- Open
- From your Eclipse,
- Select break points in the code you're running.
Run>Debug>Remote Java Application>New Launch Configuration- For the
Projectfield, select your maven project, and - For the
Port, set it to8000(8000is the default port for the Generic Maven Debugging. But you can modify it by changing theaddressfield shown in Generic Debugging - 1.2) - Press
Debugbutton to start debugging
Surefire Debugging
- From your command line,
- Append the following to your maven command.
For example, to debug the tests ran by the maven lifecycle
install, domvn install -Dmaven.surefire.debug - Wait for your maven to pause its execution and display the message,
- Append the following to your maven command.
- From your Eclipse,
- Select break points in the code you're running.
Run>Debug>Remote Java Application>New Launch Configuration- For the
Projectfield, select your maven project, and - For the
Port, set it to5005 - Press
Debugbutton to start debugging
Labels
