Like a number of us, I use Eclipse to write code and Ant to build / deploy.
Some project files however (like Jasper reports) I use external programs to
edit. One source of frustration for me is that Eclipse doesn't automatically
keep files in sync with the file system. So if you edit a file outside of
Eclipse and forget to tell Eclipse to refresh, you could end up deploying
old files and wondering why your changes aren't showing up.

However you can add an Ant task to tell Eclipse to refresh all your
project's files before building. Here's the one I use:

     <target name="refresh-project">

           <eclipse.refreshLocal resource="." depth="infinite"/>

     </target>

This is essentially a wrapper for Eclipse's IResource.refreshLocal() method
(I believe the same one that gets called when you hit the F5 key or right
click and choose refresh).

Note that this will only work if you run Ant in the same JVM that you run
Eclipse. In order to check which JVM Ant is using, right click on your
build.xml, choose Run As --> 3 Ant Build… and select the JRE tab.

This page describes some additional configuration options:
http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/ant_eclipse_tasks.htm

Hope this is useful...

Jason

Reply via email to