Bug 61686 - JDT copies random files to bin directory
Summary: JDT copies random files to bin directory
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M9   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-10 23:14 EDT by Allan Pratt CLA
Modified: 2004-05-11 06:29 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Allan Pratt CLA 2004-05-10 23:14:42 EDT
Using Eclipse dated April 13 (200404131323), when I create a Java project and 
say it should have separate source and bin directories, and then I put a file 
in the source directory that is not a *.java file, that file is always copied 
to the bin directory during automatic workspace builds.

Is that a bug? A feature? What's the intended use case for this? I don't want 
this behavior: in my situation, I want the user to create a source file which I 
will operate on with my own (non-Java) builder - why should the Java builder 
copy the file to the bin directory?

STEPS TO REPRODUCE:

* Create a Java project. In the creation wizard, say that it should have 
separate source and bin directories.
* Make sure workspace auto-build is on. (Otherwise you'll hit a different bug 
I've filed).
* Right-click the src directory of the Java project and say "New / File."
* Give the file a random name like x.y.
* Say OK to dismiss the new file wizard.

The file is immediately copied to the bin directory, as you can see in the 
Resource perspective. It will always be copied, every time the Java builder 
runs over this project. (Or maybe only when it changes or is deleted from the 
bin directory.) Why?
Comment 1 Philipe Mulet CLA 2004-05-11 06:29:29 EDT
From Help JDT FAQ:
Why are all my resources duplicated in the output folder (bin, for example)? 
If your Java project is using source folders, then in the course of compiling 
the source files in the project, the Java compiler copies non-Java resources 
to the output folder as well so that they will be available on the class path 
of the running program. To avoid certain resources to be copied to the output 
location you can set a resource filter in the compiler preferences: Window > 
Preferences > Java > Compiler > Build Path 

How do I prevent having my documentation files from being copied to the 
project's output folder? 
Use source folders and put any resources that you do not want to be copied to 
the output folder into a separate folder that is not included on the class 
path.You can also set a resource filter in the compiler preferences: Window > 
Preferences > Java > Compiler > Build Path to for example *.doc.