aspose file tools*
The moose likes Object Relational Mapping and the fly likes hibernate.cfg.xml being deleted from bin on clean in eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "hibernate.cfg.xml being deleted from bin on clean in eclipse" Watch "hibernate.cfg.xml being deleted from bin on clean in eclipse" New topic
Author

hibernate.cfg.xml being deleted from bin on clean in eclipse

Gene Hilpert
Ranch Hand

Joined: May 22, 2002
Posts: 50

When someone answers this I will most likely have a duh moment.

I have been having this problem since I started with eclipse. I use hibernate and have a hibernate.cfg.xml file in the bin directory. Sometimes when I do a compile and every time I do a clean the hibernate.cfg.xml is deleted from the bin so I have to copy it back to get my project to run. My question is how can I stop it from being deleted? There is a log4j.properties file in the same bin directory that does not get deleted, so there must be a way.
Thanks
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3775

Never put those files in the bin directory. Use src/resources directory depend on your build system. If you use Maven build it automatically copy those config files from resources directory to the build directory. For Ant builds you can customize the target to do the same.


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Gene Hilpert
Ranch Hand

Joined: May 22, 2002
Posts: 50

Thanks - I will do that
 
 
subject: hibernate.cfg.xml being deleted from bin on clean in eclipse
 
Similar Threads
Ant cannot find file, but it's there
Installing MyEclipse in Ubuntu
packing maven-plugin not creating MANIFEST file
Which hibernate property is causing the existing data to be deleted?
Applet not shown in Eclipse internal browser.