是否可以在超级开发模式下运行和调试GWT-Maven项目?

时间:2016-04-07 09:36:24

标签: java eclipse maven gwt

我对maven有一个核心概念,我希望在maven中支持GWT,因此我使用GWTmaven创建了一个项目。目前要运行这个,我必须在tomcat服务器上installmanually deployed。这真是一个时间的过程。

是否可以使用run Gwt-Mavensuper dev mode项目?

我的FishingEntry.gwt.xml

 <module rename-to='WeeklyFishingInit'>

  <inherits name="ae.ead.fishing.common.FishingCommon"/>
  <entry-point class="ae.ead.fishing.init.client.FishingEntry"/>

  <source path="client" />
  <source path="shared" />
</module>

和pom.xml是

<plugins>
    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>${gwt.maven.plugin.version}</version>
        <configuration>
                <encoding>UTF-8</encoding>
                <skip>false</skip>
                <!-- disableCastChecking>true</disableCastChecking -->
                <!-- disableClassMetadata>true</disableClassMetadata --> 
                <!-- draftCompile>true</draftCompile -->
                <!-- style>PRETTY</style-->
                <soyc>false</soyc>
                <optimizationLevel>0</optimizationLevel>
                <compileReport>false</compileReport>
                <!-- extraParam>true</extraParam -->
                <runTarget>FishingEntry.html</runTarget>
                <hostedWebapp>${webappDirectory}</hostedWebapp>
            </configuration>


    </plugin>

我的项目结构是

enter image description here

,错误是

enter image description here

我的目标文件夹是

enter image description here

2 个答案:

答案 0 :(得分:3)

当然,这就是我们运行GWT-Spring-Maven项目的方式。添加到IF NOT EXISTS (SELECT xmlRequest FROM Api_request WHERE Api_id = @Api_id) BEGIN /*if result set empty*/ /* will add some logic here */ END pom.xml插件(link),如下所示:

<强>的pom.xml

gwt-maven-plugin

根据需要进行任何配置并使用以下命令运行:

<plugins> <!-- rest of your plugins here --> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>gwt-maven-plugin</artifactId> <configuration> <runTarget>com.example.Application/Application.html</runTarget> <!--<extraJvmArgs>-Xmx6G</extraJvmArgs>--> <!--<localWorkers>1</localWorkers>--> <hostedWebapp>${project.build.directory}/${project.build.finalName}</hostedWebapp> <bindAddress>0.0.0.0</bindAddress> <i18nMessagesBundle>com.example.client.ApplicationMessages</i18nMessagesBundle> <generateDirectory>${project.basedir}/src/main/java</generateDirectory> <debugSuspend>false</debugSuspend> <deploy>${project.build.outputDirectory}</deploy> </configuration> <executions> <execution> <goals> <goal>compile</goal> </goals> </execution> </executions> </plugin> </plugins> mvn gwt:run

答案 1 :(得分:0)

我设置了这样的超级开发模式。

  1. 将配置中的launcherDir设置为war输出路径target / webapp文件夹。
  2. 然后运行,gwt:run-codeserver