Reputation: 187
I would like to commit new .class files into CVS via Eclipse, but these files get ignored, and I'm not sure where to turn that off. The Preferences windows a section for doing this, but .class isn't listed.
Upvotes: 0
Views: 3197
Reputation: 2037
If anyone is still interested, although I absolutely agree it is a bad practice to check .class files into CVS, sometimes I think it is reasonable.
For example, in my case I have an application that contains an EJB 3.1 which has to be called by an external agent (ControlM). As the EJB is called by a remote process the generated stub (.class) is needed. In this situation, I checked this generated stub class into the CVS because I want it avaliable for all the team members.
What I do is the following:
Now the .class can be committed as usual.
Upvotes: 0
Reputation: 187
I ended up figuring it out... it's a little odd: You have to go into the Preferences window (Team -> Ignored Resources) and add ".class" as an ignored resource, then uncheck the check box.
Upvotes: 1
Reputation: 11332
First of all I'd like to echo the sentiment of the other answers, in that checking the compiled source files into source control is a very bad idea, as it means any time someone makes a change to the source, they'll have to remember to checkin the corresponding class file.
Regarding your specific question, this page states that all generated .class files are automatically marked as derived, meaning they won't be checked in automatically:
Any resource marked as derived will be automatically ignored for version management by Team CVS. Some builders, such as the Java builder, mark all of its build output (e.g. .class files) as derived.
To my knowledge there no way of changing this, which should underline that this is a bad idea.
Upvotes: 1
Reputation: 7480
Preferences > Team > Ignored Resources
Also, change to the Resources Perspective to see all files.
Upvotes: 2
Reputation: 139921
Are you really sure you want to be checking compiled files into CVS? I've never worked on a project that does this - it is a bad practice.
You should only really store source code in CVS, not the files generated from the source code. There is no true need to check these in because they can be re-generated from source code at any point in time.
By checking in the output of your source code, you're only going to introduce the possibility of headaches due to someone forgetting to check a .class file in, etc.
Upvotes: 0