views:

231

answers:

1

I have two projects : my-lib and my-web.

my-lib is built using the Java compiler of Eclipse, and a short Ant task is run on some properties files, which are then modified (as explained here). This is not a pretty solution, but it works.

Now, as my-web is dependent of my-lib, I define my-lib as a Java EE Module Dependency of my-web. However, when I attach my-web to the Tomcat in Eclipse, and try to publish, I get the following exception:

'Publishing to Tomcat at localhost' has encountered a problem.
Resource is out of sync with the file system: '/my-lib/target/classes/my-app.properties'

This file is indeed one of the files modified by the Ant task.

How can I correct this problem, as I need to have the Ant task run on the my-lib.

+2  A: 

If you have the Ant task run as an external builder or external task, you can configure it to refresh the project, workspace, or selected resources after execution. When specifying the task/builder click on the Refresh tab and pick the appropriate one for your needs.

There's more information in the eclipse help.

Rich Seller