如何告诉 JBehave META-INF 使用 Maven 插件为 JPA 配置它?

发布于 2024-08-06 20:24:32 字数 899 浏览 3 评论 0原文

我正在努力让 JBehave、JPA 和 Maven 能够很好地协同工作。我可以通过 eclipse 运行测试,一切正常。我通过 maven 运行它,JPA 找不到 persistence.xml 文件。然而,我的单元测试发现 persistence.xml 文件很好,但 JBehave 不参与其中。

显然,我需要告诉 JBehave 在 src/main/resources 中查找 META-INF/persistence.xml 文件,或者至少将其放在类路径中。有办法做到这一点吗?

org.jbehave jbehave-maven-插件 2.3-rc1 运行场景发现 测试 测试 测试/nsfw/bmp/partymodel/PartySearch.java 测试/nsfw/bmp/partymodel/RealtionshihpFunctionality.java 运行场景

I'm trying to get JBehave, JPA and Maven to play nicely together. I can run the test via eclipse and everything works just fine. I run it via maven, and JPA can't find the persistence.xml file. However a unit test I have finds the persistence.xml file just fine, but JBehave is not involved.

Clearly I need to tell JBehave to look in src/main/resources for the META-INF/persistence.xml file, or get it on the classpath at least. Is there a way to do that?

org.jbehave
jbehave-maven-plugin
2.3-rc1

run-scenarios-found
test

test

test/nsfw/bmp/partymodel/PartySearch.java
test/nsfw/bmp/partymodel/RealtionshihpFunctionality.java

run-scenarios

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

长不大的小祸害 2024-08-13 20:24:32

我快速检查了 jbehave-maven-plugin 源代码,这可能是类加载器问题。但如果没有更多细节(例如您使用的插件版本、您运行的阶段、pom.xml),我唯一能做的建议就是在这里提出一个问题:http://jira.codehaus.org/browse/JBEHAVE/component/12482

I checked out quickly the jbehave-maven-plugin sources and it may be classloader issue. But without more details (e.g. the plugin version you use, the phase you run, the pom.xml), the only suggestion I can do is to open an issue here: http://jira.codehaus.org/browse/JBEHAVE/component/12482.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文