在项目源或资源中找不到GWT模块XXX

时间:2012-06-04 22:00:04

标签: gwt maven compilation vaadin

我有使用Maven目标编译的widgetset:vaadin:update-widgetset gwt:compile。所以pom.xml和web.xml文件配置应该没问题。

我是Maven的新手,这是我的第一个Maven项目。

编译后,编译后的代码显示在src / main / webapp / VAADIN / widgetsets文件夹中。当我尝试运行安装目标时,错误显示:

无法在项目中执行目标org.codehaus.mojo:gwt-maven-plugin:2.2.0:资源(默认)Validation-Manager-Web:在项目中找不到GWT模块com.pantar.widget.graph.GraphWidget来源或资源。

以下是相关文件:

POM:

        <plugins>
            <!-- Compiles your custom GWT components with the GWT compiler -->
            <!-- A hosted mode browser for client-side widget debugging can be run with the goal gwt:run after uncommenting the 
            correct line below. A remote debugger can then be connected to port 8998. Note that e.g. a Jetty server should be running 
            with the server side parts - use the goal jetty:run . -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>gwt-maven-plugin</artifactId>
                <version>${gwt.plugin.version}</version>
                <configuration>
                    <!-- if you don't specify any modules, the plugin will find them -->
                    <modules> 
                        <module>com.pantar.widget.graph.GraphWidget</module> 
                    </modules>
                    <webappDirectory>src/main/webapp/VAADIN/widgetsets</webappDirectory>
                    <!-- On Mac running Snow Leopard, add "-d32" -->
                    <!-- This causes error messages (but build works) in phase "package": two processes would use the same debug 
                    port -->
                    <!--extraJvmArgs>-Xmx512M -Xss1024k -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8998</extraJvmArgs -->
                    <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
                    <runTarget>Validation-Manager-Web</runTarget>
                    <hostedWebapp>${project.build.directory}/${project.build.finalName}</hostedWebapp>
                    <noServer>true</noServer>
                    <port>8084</port>
                    <compileReport>false</compileReport>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>resources</goal>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>com.google.gwt</groupId>
                        <artifactId>gwt-dev</artifactId>
                        <version>${gwt.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>com.google.gwt</groupId>
                        <artifactId>gwt-user</artifactId>
                        <version>${gwt.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-maven-plugin</artifactId>
                <version>1.0.2</version>
                <executions>
                    <execution>
                        <configuration>
                            <modules> 
                                <module>com.pantar.widget.graph.GraphWidget</module> 
                            </modules>
                        </configuration>
                        <goals>
                            <goal>update-widgetset</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

有什么想法吗?

提前致谢!

1 个答案:

答案 0 :(得分:1)

通过添加包含以下内容的空gwt.xml文件来修复它:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">
<module>
    <inherits name="com.vaadin.terminal.gwt.DefaultWidgetSet" />

    <inherits name="<module>" />
</module>