It is possible to start an application ready for remote debugging by using
the Maven mvnDebug command
. Eclipse or other IDE can then
connect to the running application for remote debugging.
Sometimes it is necessary to remote debug an application. For example if you want
to debug an application running on Linux, but where the developer platform is Windows.
The command mvnDebug can be used to start the application in remote
debugging mode, where it will listen on port 8000 for a remote debugger.
- Change into the Maven project directory.
-
Run mvnDebug rather than the mvn
command.
The Maven project will start and listen for a remote debugger on port 8000.
- In Eclipse, select from the main menu.
- Select Maven Build and click the New icon on the top left of the dialog.
- Give the Debug Configuration a suitable name.
- For Goals enter clean install.
- For Profile enter amp-to-war.
- In the Main tab ensure that Debug Output is selected.
- Click Apply.
- On the JRE tab add the following VM arguments: -Xms1024m -Xmx4096m -XX:PermSize=1024m to avoid PermGen exceptions.
- Click Apply.
- Click Debug to run the Debug Configuration.
- In Eclipse, click the Debug perspective.