hibernate.cfg.xml不会导出到可执行文件jar [英] hibernate.cfg.xml is not exported to executable jar

查看:60
本文介绍了hibernate.cfg.xml不会导出到可执行文件jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我试图将我的项目导出到可执行文件.jar文件时,配置文件(如hibernate.cfg.xml或log4j-properties)不会导出到jar中。我必须手动将它们添加到archieve。这些文件位于项目的根目录下的/ target /文件夹中。

When I'am trying to export my project to a executable .jar-file then configuration files like hibernate.cfg.xml or log4j-properties are not exported into the jar. I have to add them manually to the archieve. The files are located in the /target/ folder in the root folder of the project.

如何让Eclipse导出配置文件?

How do I get Eclipse to export the config files too?

推荐答案

只需创建一个与您的source / src文件夹平行的资源文件夹,并将其中的配置文件保存在其中。

Just create a resources folder parallel to your source/src folder, and keep your configuration files in it.

这篇关于hibernate.cfg.xml不会导出到可执行文件jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆