我有一個多模塊設置,其中一個子模塊是GWT和所有其他子模塊都是非GWT。這在eclipse中完美運行,我可以啓動GWT圖形和非GWT應用程序。但是我獲得以下在我的GWT基於子模塊的錯誤,當我做「MVN乾淨安裝」未能執行目標gwt-maven-plugin:2.5.1:在項目源或資源中找不到gwt模塊名稱(在eclipse中工作,但maven安裝失敗)
failed to execute goal org.codehause.mojo:gwt-maven-plugin:2.5.1: gwt module com.mycompany.projectid.basecommon.Basecommon not found in project sources or resources
我回顧GWT. Maven. GWT Module <module_name> not found in project sources or resources類似的問題,但沒有幫助的(因爲我不把它理解爲我的POM沒有資源)
下面是用於非GWT代碼POM文件(基本上這個子模塊具有將由GWT的客戶端和所有其他非GWT模塊使用少數的DTO)
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.harmonia</groupId>
<artifactId>cbm</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>base-common</artifactId>
<name>BASE-COMMONS</name>
<description>BASE-COMMONS</description>
<packaging>jar</packaging>
</project>
Basecommon gwt.xml文件列下面,它在src/main/java/com/myco mpany /專案編號/ basecommon/Basecommon.gwt.xml
<module>
<inherits name='com.google.gwt.user.User'/>
<source path='dto' />
基於GWT Module ... not found in project sources or resources,我添加以下行到我的基於GWT子模塊,但沒有運氣
<configuration>
<module>com.harmonia.cbm.basecommon.Basecommon</module>
<inplace>true</inplace>
<force>true</force>
</configuration>
最後,我打開使用Basecommon.jar文件(所有DTO都是非gwt子模塊),並且它沒有任何gwt.xml文件(它只有.class文件)。 任何提示讚賞(我是很新的GWT和幾個月前的maven)
@Broyer:謝謝你的詳細解答。這有所幫助。我可以問你一個關於如何使用gwt:resources或者gwt:source-jar的鏈接(pom.xml)。我發現這個http:// mojo。codehaus.org/gwt-maven-plugin/resources-mojo.html,但它沒有關於如何在pom.xml中使用它的例子(可能這太基本了/緊張) –
有一個http中的'resources'的例子://mojo.codehaus.org/gwt-maven-plugin/user-guide/library.html –