我有一个使用 gwt 的项目,并且依赖于我公司 svn 中的几个组件。在我的 MainApp.gwt.xml 中,我继承了这些模块。问题是,其中一个似乎不是 gwt 模块,所以我得到这个错误:
ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] GWT Module com.sample.project.sample-module-b not found in project sources or resources.
但我也不能只删除它,因为还有另一个模块需要来自这个模块-b 的源代码。如果我删除行
<inherits name="com.sample.project.sample-module-b"/>
从我的 MainApp.gwt.xml 我得到以下错误:
[ERROR] Errors in 'jar:file:/C:/pathToRepository/com/sample/project/sample-module-a/0.1-SNAPSHOT-sources.jar!/com/sample/project/a/to/ClassA.java'
[ERROR] Line 23: No source code is available for type com.sample.project.module-b.ClassB; did you forget to inherit a required module?
我将 module-a 和 module-b 添加到我的 maven-dependencies 中,但这并没有起到作用。 是否有可能继承该模块,尽管它不是 gwt 模块? 我自己的类从不直接使用 module-b,只是在这个依赖中。 我如何告诉 module-a 或我的 MainApp 使用来自 module-b 的源而不将其视为 gwt 模块? 希望有人能给我一个提示。 最好的问候,凯兹
最佳答案
为了解决这个问题,我必须执行以下操作: 在我的 MainApp src/main/resources 文件夹下,我放置了文件夹结构 com.sample.project。在该文件夹中,我创建了文件 module-b.gwt.xml,一切正常。
关于java - 继承一个非gwt模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17236165/