How to debug a new module during development

Application Name: : OpenMrs

Question:

I a new developer,finding difficulty in debugging a code while developing a new modules at present i am debugging code by writing junit test cases. Is any better approach to debug code for controllers . (typically which we do for normal webapp by putting debug breakpoints and run controllers form web)

You can still write unit tests for controllers. Have you looked at examples like? https://github.com/openmrs/openmrs-module-legacyui/blob/master/omod/src/test/java/org/openmrs/scheduler/web/controller/SchedulerFormControllerTest.java

Hi Daniel,Thanks for your reply. I want to debug through IDE Eclipse.I do not want to create unit test cases for a quick debug.I would like to put markers for debugging and understand navigation flow.

So i retried to package as WAR application so that i can debug my project Steps I have followed

My project structure is 
Parent
| - - Api
| - - Web

So i tried to reconfigure pom packaging for parent (POM),api (JAR),Web (war) below is my config but i am getting noclassdeffounderror exception . which i have posted in forum.

See the ‘How to Debug a Module with Eclipse’ section on this page

Hi Wyclif,Thanks for your reply. But in order to do remote debug.At the time of development of a new module to test for each and every change i have to compile and build a jar file and then copy to .Omod/Modules folder and then restart the tomcat server . Is there any better and simple approach to debug insted of copying jar file module folder and then restart .

@arunkumar take a look at this blog https://ssmusoke.com/2015/09/24/openmrs-module-development-learnings-102/

Unfortunately, every time you make changes to a module, you have to reinstall. If you are using the new uiframework, it does support hot deployment of controllers, jsp, js and css files, to set this up see this

@wyclif Thanks for reply