maven etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
maven etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

19 Mayıs 2013 Pazar

debug maven project in eclipse

This post (http://www.homik.de/think/index.php/2008/07/31/debugging-maven-projects-with-eclipse/) explains how to debug a maven project with eclipse ide. i just copy the steps from that post:

  • Create a new Java Project and call it “Maven Debug”. This Project willnever have any source code in it, it is just a shell for attaching the debugger.
  • Create a debug configuration: Run -> Debug Configurations and then right click on Remote Java Application and select New launch configuration. Call it “Maven Surefire”.
  • On the Connect tab click the Browse button and select the “Maven Debug” project.
  • Set connection properties to localhost and port 5005. This is the port on which Surefire waits for the debugger.
  • The connection type is Standard (Socket Attach)
  • On the Source tab add all projects that have any Maven source that you want to debug.

During debugging process:
  • Select break points in the code you’re are going to run. Note, you cn select only code in your test classes. It won’t work on classes outside the test phase.
  • In your command line, append the following switch to your maven command: -Dmaven.surefire.debug. For example, to debug the tests run by the maven lifecycle install do mvn install -Dmaven.surefire.debug
  • Wait for maven to pause its execution and display the message: Listeningfor transport dt_socket at address: 5005
  • Attach the debugger to the running maven by selecting the “Maven Surefire” debug configuration created above. Your debugger should stop at your breakpoint.


install maven plugin

I have discovered an API that can be useful to my thesis project. Unfortunately, the API address is broken at the moment. However, i could be able to find source code which is maven project. Therefore, i installed maven in my Eclipse Juno. http://stackoverflow.com/questions/11242107/maven-with-eclipse-juno is helpful for this purpose.
In summary,
  • Install maven 
  • In Eclipse IDE, do Help -> Install New Software as follows: (installing maven for eclipse plugin)


After a successful installation, I imported the maven project by doing File -> Import as follows:



However, I got the following error during import process:



However changing maven installation path in Eclipse via Preferences interface did not help to resolve the problem :( So I continued the import process with errors..



EDIT 13:49
The problem was due to my import project style.. I included all the pom files at first, however importing only the pom in the parent directory was enough! That solved the situation in my condition..