GWT 2.5.1 mvn安装错误“重新绑定结果<class>必须是类”</class>

时间:2013-11-15 18:28:32

标签: maven gwt

问题:我在我使用gwt-maven-plugin构建的GWT 2.5.1项目上运行mvn gwt:compile并获取错误Rebind结果必须是所有类中的类我有扩展CssResource。

这门课程就是其中之一:

public interface MainShellStyle extends CssResource{

    public static final MainShellStyle INSTANCE =  GWT.create(MainShellStyle.class);

    public String txtCompanyName();
    public String txtCompanySlogan();
    public String txtCompanyMessage();
    public String topRibbon();
    public String mainMenu();

    public String btnEditContacts();
    public String btnEditGuestBook();
    public String btnEditPictures();
    public String btnEditHome();
}

我的pom.xml如下:

<!-- Dependecies --!>
<build>

        <!-- Generate compiled stuff in the folder used for development mode -->
        <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>

        <!-- Plugins -->

        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <archiveClasses>true</archiveClasses>
                    <webResources>
                        <!-- in order to interpolate version from pom into appengine-web.xml -->
                        <resource>
                            <directory>${basedir}/src/main/webapp/WEB-INF</directory>
                            <filtering>true</filtering>
                            <targetPath>WEB-INF</targetPath>
                        </resource>

                        <resource>
                            <directory>${basedir}/src/main/webapp/js</directory>
                            <filtering>false</filtering>
                            <targetPath>js</targetPath>
                        </resource>
                    </webResources>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>gwt-maven-plugin</artifactId>
                <version>${gwt.version}</version>

                <!-- Plugin configuration. There are many available options, see gwt-maven-plugin 
                    documentation at codehaus.org -->
                <configuration>
                    <!-- URL that should be automatically opened in the GWT shell (gwt:run). -->
                    <runTarget>Webmetalmore.html</runTarget>
                    <!-- Ask GWT to create the Story of Your Compile (SOYC) (gwt:compile) -->
                    <compileReport>true</compileReport>
                    <module>com.ohapp.webmetalmore.Webmetalmore</module>
                    <logLevel>INFO</logLevel>
                    <style>${gwt.style}</style>

                    <copyWebapp>true</copyWebapp>
                </configuration>

                <dependencies>
                    <dependency>
                        <groupId>com.google.gwt</groupId>
                        <artifactId>gwt-user</artifactId>
                        <version>${gwt.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>com.google.gwt</groupId>
                        <artifactId>gwt-dev</artifactId>
                        <version>${gwt.version}</version>
                    </dependency>
                </dependencies>
                <!-- JS is only needed in the package phase, this speeds up testing -->
                <executions>
                    <execution>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>

        <!-- End Plugins -->

    </build>

这是我第一次编译GWT项目。我做错了什么?

感谢。

1 个答案:

答案 0 :(得分:1)

您不能GWT.create() CssResource个界面,您必须从ClientBundle GWT.create()引用它。与CSS文件的关联来自ClientBundle方法。

请参阅http://www.gwtproject.org/doc/latest/DevGuideClientBundle.html