Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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: 3974
24
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!