【发布时间】:2018-02-13 21:38:12
【问题描述】:
我有一个想要迁移到 Maven 的 GWT 项目。
1) 在使用 Maven 之前,为了编译 GWT,我使用以下代码执行了一个 .bat 文件:
/thisFolder是我期望的编译文件目录
call env
cd "\thisFolder"
%JAVA_HOME_GWT%/java -Xmx1024m -Dgwt.nowarn.legacy.tools -cp %GWT_HOME%/gwt-user.jar;%GWT_HOME%/gwt-dev.jar;%GWT_HOME%/validation-api-1.0.0.GA.jar;%GWT_HOME%/validation-api-1.0.0.GA-sources.jar;%GWT_EXT%/gwtext.jar" com.google.gwt.dev.Compiler -war "%URL_PROJECT_BASE%/%URL_COMPILE_PROJECT_CLIENT%" %* -style OBF com.myproject.client.gwt.ProjectClient
pause
由于第二行改变了目录,所以编译后的文件创建到这个directory:...\thisFolder\com.myproject.client.gwt.ProjectClient
2) 现在我想做同样的事情,但是使用 gwt-maven-plugin,所以根据我发现的一些帖子,我对插件配置进行了一些更改以设置 @987654325 @files 输出目录到...\thisFolder
These are some of the labels I tried to use:
- <hostedWebapp>${project.build.directory}/thisFolder</hostedWebapp>
- <extraJvmArgs>-Djava.io.tmpdir=${project.build.directory}/thisFolder</extraJvmArgs>
- <outputDirectory>${project.build.directory}/thisFolder</outputDirectory>
- <war>${project.build.directory}/thisFolder</war>
- <deploy>${project.build.directory}/thisFolder</deploy>
但是在编译 GWT 之后,它会显示一条带有 directory 的消息,其中放置了 *.cache.html (or *.cache.js),这不是我预期的路径(此控制台输出中的最后一行)。
[INFO] Compiling permutation 10...
[INFO] Compiling
[INFO] Compiling permutation 11...
[INFO] Compiling
[INFO] Compiling permutation 12...
[INFO] Compiling
[INFO] Compiling permutation 13...
[INFO] Compiling permutation 14...
[INFO] Compile of permutations succeeded
[INFO] Compilation succeeded -- 54,216s
[INFO] Linking into D:\Java\MyProject\mainProject\target\mainProject\com.myproject.client.gwt.ProjectClient
设置*.cache.html 文件输出目录的正确方法是什么?
这是pom.xml gwt 插件配置:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>${gwt.version}</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>generateAsync</goal>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<extraJvmArgs>-Xmx1024m -Xss1024k -Dgwt.nowarn.legacy.tools</extraJvmArgs>
<draftCompile>true</draftCompile>
<debugSuspend>false</debugSuspend>
<logLevel>INFO</logLevel>
<style>OBF</style>
<noServer>true</noServer>
<runTarget>http://localhost:${glassfish.port}/${project.build.finalName}/${project.build.finalName}.html</runTarget>
<buildOutputDirectory>${project.build.outputDirectory}</buildOutputDirectory>
<deploy>${project.build.outputDirectory}/deploy</deploy>
<copyWebapp>true</copyWebapp>
</configuration>
</plugin>
【问题讨论】:
标签: java eclipse maven gwt maven-plugin