使用 persistence.xml 对 maven 进行参数化不适用于 hibernate 搜索

问题描述 投票:0回答:1

我已经在maven中设置了一个配置文件,例如

    <profile>
      <id>dev</id>
      <properties>
        <hibernate.search>//devserver/srchIndexes/</hibernate.search>
      </properties>
    </profile>

persistence.xml
中,我已指定...

property name="hibernate.search.default.indexBase" value="${hibernate.Search}" />

我只想传递基于 DEV/QA/Prod 的服务器/文件夹位置。

但是当部署战争到tomcat时, hibernate 搜索文件夹在 tomcat 文件夹中创建为

${hibernate.Search}
。将值从 maven 传递到
xml
不起作用。

我正在使用此命令来构建项目。

mvn -Pdev install -DskipTests=true
hibernate maven tomcat7 jboss-seam
1个回答
0
投票

发现问题,在 scr 主资源的 pom 中添加“true”解决了问题

© www.soinside.com 2019 - 2024. All rights reserved.