Ahmed
Ahmed

Reputation: 3270

How to debug ant build war files

I use ant script to create a war file of my application. Is there a way to debug my application in eclipse?

Upvotes: 1

Views: 2706

Answers (2)

Nandkumar Tekale
Nandkumar Tekale

Reputation: 16158

If you are using tomcat server. Install Mongrel plug-in to your eclipse. After building ant script, just add break points to code and click on tomcat start button provided by Mongrel plug-in. Your app will be automatically running in debug mode. And Mongrel(Tomcat) automatically deploys your war file.

I am currently using the same for my projects.

Upvotes: 1

Arjan Tijms
Arjan Tijms

Reputation: 38163

If you have all the source code in Eclipse and merely use the ant script for building, you should be able to do debugging by just putting the generated war in the deploy folder of your server (or doing whatever else your server requires to deploy a war), and then simply start up your server via Eclipse.

Eclipse wouldn't 'know' that anything has been deployed to the server it has just started, but the connection between WTP's deployer and JDT's debugger is pretty weak anyway. It will simply try to match classes in the JVM to Java files in your workspace. If you have the actual source there this will of course match and you can debug.

Upvotes: 0

Related Questions