To enable breakpoints and debugging in Eclipse for DHIS 2 Web development, first set up a debugger:
- Right-click any project in Eclipse, e.g. dhis-web-dataentry, and go to "Debug As" > "Debug Configurations".
- Right-click "Remote Java Application" and click "New". Leave settings under Connect as it is.
- Click "Source" tab, then "Add", then "Java project", then "Select All" and "OK".
- Click "Apply".
To start debugging a web project from the command line:
- In the terminal navigate to a web project directory and execute "mvnDebug jetty:run" to start the Maven Jetty plugin. It will output "Listening for transport dt_socket".
- Go back to Eclipse, find the debugger and click "Debug". You can see the Jetty plugin continue to start up in the terminal.
- You can now define your break-points anywhere in the code. Watch the breakpoints kick in while you use the web application.