Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When does Eclipse copy resources to the output folder?

Tags:

java

eclipse

I noticed that "sometimes" the resources i put into a source folder in my Eclipse project will not be copied to the output folder ("bin") immediately.
E.g. i change a properties file using the eclipse editor and save... and "bin" still has the old version.

Does anyone know what exactly triggers the copying (and how i can trigger that from a plugin)? I thought it happened automatically when a resource changes.

-- EDIT --

To clarify what i meant by triggering it from a plugin: I have a plugin that depends on up to date resources in the output folder, but apparently the resources are outdated when my plugin is called. And that's why i need to better understand what happens and how i can force it when i need to.

like image 755
Stroboskop Avatar asked Jul 15 '10 10:07

Stroboskop


Video Answer


2 Answers

If you don't add the resource through eclipse (but for instance through the windows explorer), eclipse wont notice some changes until you refresh your project/folder. (right click in the packater explorer for instance).

After it notices the change it will copy it to the output folder when you build (often this is done automatically upon changes)

like image 102
Thirler Avatar answered Nov 14 '22 14:11

Thirler


This is a Bug in almost all Eclipse versions, it happens without any reason. My eclipse 3.5.2 and 3.6.2 both meet this problem in someday. In my case, I need to copy modified .clj clojure source files to classes directory for immediate effection in a web app, now I have to set /src before /classes in CLASSPATH of web appserver startup script, It's solve my problem temporarily.

like image 35
jamesqiu Avatar answered Nov 14 '22 14:11

jamesqiu