Maven build debug in Eclipse

后端 未结 4 1469
别那么骄傲
别那么骄傲 2020-12-12 19:03

I want to debug Eclipse build with tests. I tried to run it by Run > Debug Configurations > Maven Build. In Base directory is my Maven repo directory with pom.xml file, in g

4条回答
  •  没有蜡笔的小新
    2020-12-12 19:52

    probleme : unit test result are not the same runing with eclipse and maven due ti order of library used by eclipse and maven. In my case the test was success with maven but i want to debug my unit test using eclipse, so the most easy way to debug unit test class with eclipse and runing maven is :

    1) mvn -Dtest=MySuperClassTest -Dmaven.surefire.debug test ==> it will listen to the 5005 port (default port)

    2) Go to eclipse, open a debug configuration, add a new java remote application and change the port to 5005 and debug

    3) of course you must add break point somewhere in the class that you want to debug

提交回复
热议问题