您的位置:首页 > 其它

Maven 项目不打包 *.hbm.xml 映射文件

2016-09-22 12:47 337 查看
使用 Maven 部署 Java
Web 项目时,hibernate 的映射文件
*.hbm.xml 或者 *.properties没有被打包部署到目标目录下,解决方法:在 pom.xml 文件中 <build> 节点下添加以下代码:

<build>
……
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.hbm.xml</include>
<span style="white-space:pre"></span><pre name="code" class="html" style="color: rgb(51, 51, 51); font-size: 14px;"><span style="white-space:pre">			</span><include>**/*.properties</include>


<span style="white-space:pre">		</span> </includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
……
</build>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: