Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Gene Hilpert
Ranch Hand
Posts: 51
Eclipse IDE Hibernate Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3914
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Gene Hilpert
Ranch Hand
Posts: 51
Eclipse IDE Hibernate Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks - I will do that
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic