2013-01-25 57 views
0

我有一個GWT項目(父)引用另一個GWT項目(孩子),但是當我建立父項目,我滿足這個錯誤:如何使用maven將另一個gwt項目添加到類路徑中?

[ERROR] Unable to find 'com/company/package/conf.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?

誰能告訴我如何子項目添加到使用maven的父項目的類路徑?

+0

「conf.gwt.xml」在哪裏? ('src/main/java'或'src/main/resources'?)你是如何引用另一個項目的? (反應堆構建,還是已經部署/安裝在Maven回購中的依賴項?)您正在使用哪個Maven目標? (之前還是之後/等於'package'?) –

+0

conf.gwt.xml位於子項目中。 – eric2323223

+0

父項目在gwt.xml中有以下條目: eric2323223

回答

0

選擇構建路徑 - >配置構建路徑 - >項目 - >添加 - >(您想添加選擇的項目) 點擊訂單和出口,並選擇項目

繼承.gwt上述模塊。 xml文件

如:<inherits name='com.mycompany.ProjectName'/>(如果你在包com.mycompany有ProjectName.gwt.xml則繼承這樣)

添加外部JAR參考以下鏈接:

Adding external jar in GWT

0

父項目通常只是一個shell。

理想情況下,您應該選擇Parent,Child 1和Child 2. Child 1將擁有conf.gwt.xml模塊,Child 2應該使用Child 1並構建/部署帶入口點的gwt模塊進行戰爭!

Maven Parent Project A 

--> Maven Child Project B1 (gwt-module common.gwt.xml) 

--> Maven Child Project B2 (gwt-module b2.gwt.xml) -> dependency on B1 and inherits common.gwt.xml 

--> Maven Child Project B3 (gwt-module b3.gwt.xml) 

--> Maven Child Project B4 (gwt-module app.gwt.xml) -> dependency on B1, B2, B3 and inherits common.gwt.xml, b3.gwt.xml and b3.gwt.xml and has entrypoint tag in its app.gwt.xml file 

您對maven項目組織有更多的疑問。你可以找到所有關於maven子模塊 - http://www.sonatype.com/books/mvnref-book/reference/

+0

我是gwt新手,能否詳細解釋一下? – eric2323223

相關問題