1 回答

TA貢獻1891條經驗 獲得超3個贊
無需更改項目的結構,盡管您會錯過通過 maven 模塊(不要與 gwt 模塊混淆)完全分離客戶端和服務器代碼的機會。
所以說這是一個如何在沒有多個 maven 模塊的情況下使用新的 GWT maven 插件的
示例 :只有一個 Maven 模塊的示例項目結構:https : //github.com/branflake2267/Archetypes/tree/master/archetypes/gwt -基本的rpc
如果您在一個 maven 模塊中有多個 GWT 模塊,那么您必須指定多個執行。(與舊插件不同):
具有多個 GWT 模塊的示例插件配置:
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<executions>
<execution>
<id>compile-module1</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<moduleName>com.example.module1.Module1</moduleName>
<moduleShortName>module1</moduleShortName>
<compilerArgs>
<compilerArg>-localWorkers</compilerArg>
<compilerArg>4</compilerArg>
<compilerArg>-draftCompile</compilerArg>
</compilerArgs>
</configuration>
</execution>
<execution>
<id>compile-module1</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<moduleName>com.example.module2.Module2</moduleName>
<moduleShortName>module2</moduleShortName>
<compilerArgs>
<compilerArg>-draftCompile</compilerArg>
</compilerArgs>
</configuration>
</execution>
</executions>
</plugin>
插件網站上還有一個小的遷移指南。
如果您對正確的多模塊設置的外觀感興趣,請參閱此處。
添加回答
舉報