我正在将遗留的 Spring 项目构建脚本从 Ant 重写为 Maven。该项目有几个 GWT 模块,每个模块都编译为 JAR。当前的项目结构由几个 Maven 模块组成,大致是这样的:
mainProject
|- AnalyzerGWT <-- this module uses GWT
|- analyzer <-- this doesn't
|- someOtherModule
|- p4you-spring <-- this module has resources and builds WAR
每个使用 GWT 的模块在其pom.xml中都有以下代码(模块称为AnalyzerGWT):
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<gwtSdkFirstInClasspath>true</gwtSdkFirstInClasspath>
<compileSourcesArtifacts>
<artifact>com.pamm:portal-common</artifact>
<artifact>com.pamm:analyzer</artifact>
</compileSourcesArtifacts>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
它编译成功,结果 GWT 资源保存到AnalyzerGWT/target/AnalyzerGWT-1.0/com.pamm.analyzer.gwt.Analyzer/中,但是该目录的内容不包含在结果 JAR 文件中。
有没有一种优雅的方法可以将此目录的内容复制到 JAR 的根路径中?