gwt - Eclipse 中的 Maven 子模块 : Resources from one module not found in another

标签 gwt maven

我有以下 Maven 项目结构:

Example
-Persistence
-GWTApp

持久性在src/main/resources/META-INF 中有persistence.xml ,并且在单一测试中运行良好。

我需要在 GWTApp 项目中使用它。因此,我将其添加为依赖项。像这样:
<dependency>
    <groupId>com.example</groupId>
    <artifactId>Persistence</artifactId>
    <version>0.0.1</version>
</dependency>

有了这个,我可以在我的 webapp 中查看和使用持久性类,但是,当我在 eclipse 中运行 webproject 时,我得到了这个错误:

javax.persistence.PersistenceException: No Persistence provider for EntityManager named exemplo



我认为这是因为eclipse在引用webapp项目中的持久性项目的项目之间完成了这个“链接”,而不是使用jar文件。也许我错了,这只是一个猜测。

有人知道我该如何解决这个问题?
提前致谢。

编辑

我做了更多的测试,现在我认为问题出在 GWT 开发模式和 JPA 或其他问题上。
我试图手动将 persistence.xml 复制到 weapp/META-INFtarget/project-webapp-0.0.1-SNAPSHOT/META-INF并且错误仍然存​​在。

任何的想法?

最佳答案

您是否正确启动了应用程序? https://developers.google.com/eclipse/docs/faq#gwt_with_maven

特别要注意,您必须“mvn war:exploded”复制您的依赖项 target/myapp-0.0.1-SNAPSHOT/WEB-INF/lib

关于gwt - Eclipse 中的 Maven 子模块 : Resources from one module not found in another,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10252845/

相关文章:

javascript - 声音未播放

gwt - 从另一个 Composite 调用 Composite 的 GWT 方法

java - GWT UIBinder 类型不匹配 : cannot convert from ImageResource to Image

java - 如何设置文本按钮的样式?

jsp - JSTL forEach 在 JSP 中不起作用

java - org.springframework.security.authentication.encoding 在 maven 中不存在

java - 将类名添加到uibinder xml文件中的元素

git - Jenkins 中的 Bitbucket 不工作

Maven:不可解析的父 POM 和 'parent.relativePath' 指向错误的本地 POM

java - 未命名的模块从两者读取包javax.websocket