You need to forget that you can run JUnit tests and ANT targets from Eclipse. You want to debug a Java application that has the main class org.apache.tools.ant.Main and which can be started using ant from the command line.
Now you have two options: you can create a startup configuration that calls org.apache.tools.ant.Main , but which is quite complicated to configure (you will have to replicate everything that the ant script does at startup).
Another alternative is to properly configure ant . In your case, tests are performed as part of the ant process, but I don’t know an easy way to pass -Xdebug to ANT. Therefore, you must run the tests in a new process. Add this to your junit task:
<junit fork="yes" forkmode="once" ...>
Without this, jvmarg parameters will be ignored.
The next step is to create a debug configuration in Eclipse. This article explains this in detail. For you, only the last part immediately before the "Conclusion" is important.
Aaron digulla
source share