m. vokhm
m. vokhm

Reputation: 699

Why Eclipse copies unnecessary files into the bin folder?

I work on a java project in Eclipse (Mars.1 Release (4.5.1)) and sometimes build an executable jar with ant. In my project folder, I have several working files and directories which are frequently used in my work but are not parts of the project (execution logs, some temp files etc). I need them to be at hand, but I don't need them in the jar. For unknown reason, Eclipse (or, may be, ant?) sometimes copies them into the bin folder, and when I build the jar they get packed into it. I can not figure out the exact moment when these files get copied into the bin folder. In order to keep the jar clean, I have to constantly keep my eyes on the bin folder and delete the unnecessary files manually. I don't like it. Why do Eclipse (or, may be, ant?) behaves this way and how can I prevent this?

Upvotes: 0

Views: 2956

Answers (1)

greg-449
greg-449

Reputation: 111142

Eclipse defaults to copying everything from your Source folder(s) to the output (bin) folder.

You can control this in the 'Java Build Path' page of the Project Properties.

Select the 'Source' tab and expand the 'Source folders on build path' entry. You should see 'Included (All)' and 'Excluded (None)' entries. You can edit these to control what is copied.

Upvotes: 3

Related Questions