我在Win XP上使用IntelliJ IDEA 8.1.2。我有一个Maven 3.0.3项目,使用GWT 2.4插件。它配置如下......
<!-- GWT Maven Plugin -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>${gwtVersion}</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test</goal>
<!-- <goal>i18n</goal> <goal>generateAsync</goal> -->
</goals>
</execution>
</executions>
<!-- Plugin configuration. There are many available options, see gwt-maven-plugin
documentation at codehaus.org -->
<configuration>
<runTarget>index.html</runTarget>
<hostedWebapp>${webappDirectory}</hostedWebapp>
<i18nMessagesBundle>com.cme.clearing.product.client.Messages</i18nMessagesBundle>
</configuration>
</plugin>
在IntelliJ中,如何运行和调试此项目? Google推荐的唯一相关链接 - http://antonkirillov.wordpress.com/2011/03/22/creating-and-running-gwt-project-using-maven-and-intellij-idea-10/被我们的公司防火墙阻止。
如果它有用,我也在本地安装了Tomcat 6.0.33。
谢谢, - 戴夫
答案 0 :(得分:7)
@Vijay Krishna这对我不起作用,我的解决方案是。
答案 1 :(得分:4)
到目前为止,我找到的唯一方法是创建2个运行配置。
现在做:
到目前为止,这是对我有用的唯一方法。我正在寻找一个单击选项:)
答案 2 :(得分:-1)
我可以将IntelliJ调试器配置为与maven一起正常工作。这就是我所做的:
这是pom.xml:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt</artifactId>
<version>2.7.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencys>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<!-- "provided" so that we don't deploy -->
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<!-- "provided" so that we don't deploy -->
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-codeserver</artifactId>
<!-- "provided" so that we don't deploy -->
<scope>provided</scope>
</dependency>
</dependencys>
<build>
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
<finalName>rap-maven-1.0</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.7.0-SNAPSHOT</version>
<configuration>
<logLevel>INFO</logLevel>
<style>${gwt.style}</style>
<compileReport>true</compileReport>
<hostedWebapp>${webappDirectory}</hostedWebapp>
<runTarget>index.html</runTarget>
<module>Project</module>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>generateAsync</goal>
</goals>
</execution>
</executions>
</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>
创建IntelliJ运行/调试配置。在我的情况下,我的模块名称是rap-maven,我的启动网页是test.html
在GWT Facet中,OutputRelativePath必须 /target/rap-maven-1.0/project :
在Web Facet中,Web资源目录必须位于 C:\ Proyectos \ Vulcano \ RAP \ rap-maven \ target \ rap-maven-1.0 :
test.html中的脚本链接是
<script type="text/javascript" language="javascript" src="project/project.nocache.js"></script>
希望这可能有用。