2013-06-21 146 views
2

我有一个使用gwt的项目,并对我公司的svn中的多个组件有依赖性。在我的MainApp.gwt.xml中,我继承了这些模块。问题是,这些中的一个似乎不是一个GWT模块,所以我得到这个错误:继承非gwt模块

ERROR] BUILD ERROR 
[INFO] ------------------------------------------------------------------------ 
[INFO] GWT Module com.sample.project.sample-module-b not found in project sources or resources. 

但我也不能删除它,因为有另一个模块,从这个需求来源模块-b中。如果我从MainApp.gwt.xml删除线

<inherits name="com.sample.project.sample-module-b"/> 

我得到以下错误:

[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? 

我加了两个模块,一个模块和-B到我的Maven的依赖关系,但没有做到这一点。 有没有可能继承该模块,但它不是gwt模块? 我自己的类永远不会直接使用module-b,只是在这个依赖中。 如何告诉module-a或我的MainApp使用来自模块b的源而不将其视为gwt模块? 希望有人能给我一个提示。 最好的问候Kayz

+1

如果您在客户端使用该代码,则需要继承该模块。因此,最好通过添加gwt.xml来声明sample-module-b为gwt模块 – Bitman

+0

我不能那样做,因为module-a和module-b不在我的控制之下,它们是某个elses组件。但我会请他这么做,谢谢。 – Kayz

+1

@IvanM您的解决方案对我来说确实有效。我“受骗”了一点。在我的MainApp src/main/resources文件夹下,我放置了文件夹结构com.sample.project。在该项目文件夹中,我创建了module-b.gwt.xml文件。 非常感谢提示! – Kayz

回答

0

为了解决这个问题,我不得不做以下几点: 在我的MainApp src/main/resources文件夹下,我放置了文件夹结构com.sample.project。在该文件夹中,我创建了文件module-b.gwt.xml,一切正常。