【发布时间】:2015-02-10 13:46:22
【问题描述】:
我正在尝试设置我的项目以使用 gwt maven 插件。它编译正确,但我无法使用开发模式或超级开发模式进行开发。
我的设置如下:
Maven 配置顺序
mvn clean install
mvn tomcat7:run-war-only
mvn gwt:run-codeserver
GWT 版本:2.6.1
IDE:Intellij 14 Community Edition
当我对客户端 java 文件进行更改并单击代码服务器页面上的“编译”按钮时,它们不会反映在网页上。我怀疑代码服务器没有查看我正在更改的相同来源。具体来说,我认为它正在寻找要在 target/{project-name}/* 中编译的源代码
以下是我正在使用的 POM 文件的 sn-p。
<sourceDirectory>src/main/java</sourceDirectory>
<resources>
<resource>
<directory>src/main/java</directory>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}/WEB-INF/classes</outputDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.plugin.version}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
<!--compilerArgument>-proc:none</compilerArgument-->
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0</version>
<configuration>
<path>${tomcat.context}</path>
<port>${tomcat.webport}</port>
<ajpPort>${tomcat.ajpport}</ajpPort>
<contextReloadable>true</contextReloadable>
</configuration>
</plugin>
<!-- GWT Maven Plugin -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>${maven.gwt.plugin.version}</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
<configuration>
<draftCompile>true</draftCompile>
<hostedWebapp>${webappDirectory}</hostedWebapp>
<noServer>true</noServer>
<port>${tomcat.webport}</port>
<runTarget>${tomcat.context}/index.html</runTarget>
<!--codeServerWorkDir>${webappDirectory}</codeServerWorkDir-->
<copyWebapp>true</copyWebapp>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>exploded</goal>
</goals>
</execution>
</executions>
<configuration>
<webappDirectory>${webappDirectory}</webappDirectory>
</configuration>
</plugin>
</plugins>
</build>
任何帮助将不胜感激!
【问题讨论】:
-
你能显示你的projectname.gwt.xml吗?您的模块 xml 中有以下配置吗?
-
是的。我有那些台词。现在,我每次都重新运行 gwt:run-codeserver 步骤以反映更改。简单的“编译”只是重新编译旧代码。
-
@ChrisHinshaw
devModeRedirectEnabled在 2.6.1 中不需要(而xsiframe是 2.7 BTW 中的默认值)
标签: java maven gwt intellij-idea