3. Implementation/Spring

Spring MVC and HDIV example application and Debugging

SSKK 2015. 4. 7. 23:24

Source: https://github.com/hdiv/hdiv-spring-mvc-showcase.git            

Reference: http://javahotpot.blogspot.in/2013/11/running-tomcat-maven-plugin-in-debug.html


I'll explain how to add showcase sample into the eclipse from git repository above then how to set the debugging environment step by step. 


1. Make a eclipse project


  • Select Import from the context menu in the Navigator or Project Explorer
  • Navigate to the Git folder and select "Projects from Git"
  • Select "Clone URI" from the repository source page
  • Paste the following URI into the URI 
https://github.com/hdiv/hdiv-spring-mvc-showcase.git
  • Then click Next Until "Select a wizard to use for importing projects" page is shown
  • Select "Import s general project"
In my case, other option could not import any project
  • Finally click Finish.

2. Set up the debug environment for this sample

  • Open the context menu by clicking the right mouse button on the Navigator or Project explorer
  • Go to the "Debug As" menu and select the "Debug configurations..."
  • Select "Maven Build" like the following


  • Click the right mouse button on the "Maven Build" then select "New"
  • The new configuration will be made like the following then enter name as "Debug tomcat"


  • It's time to specify "Base directory". Click "Browse Workspace" and select "hdiv-spring-mvc-showcase" as shown in the following figure.


  • Then click the Source tab and click "Add" like the following


  • Select Project like the figure above then click OK. and select "hdiv-spring-mvc-showcase".
  • Finally press the "Debug" button. 

That's all. If you meet some error, try to build maven project then start debugging. If you finished all the steps above, you can easily start debugging by clicking the menu like the following: