如何在vadin中编译widgetSet



我正在尝试使用visualizationsforvadin插件。问题是,我必须编译一个自定义widgetSet。我一整天都在处理这个问题,但仍然无法编译它。首先,这是我的配置:

  • vadin 6.7.1
  • gwt tripwire

下列依赖项在我的pom文件中:

  • gwt-ajaxloader 1.1.0
  • 验证api 1.0.0 . ga
  • gwt-visualization 1.0.2
  • gwt用户tripwire
  • visualizationsforvaadin 1.1.2。

当我尝试编译widgetSet与maven gwt插件我得到一个异常:

Loading inherited module 'com.google.gwt.core.XSLinker'
[ERROR] Line 22: Unexpected element 'when-linker-added'
[ERROR] Failure while parsing XML
有趣的是,自动加载的gwt-dev库(据我所知)是2.0.3版本我已经尝试了所有可能的(甚至是不可能的)方法,但还是一无所获。在某些时候,我遇到了其他异常,抱怨无法解决验证类的导入。我想,这已经被其他依赖项解决了。请帮助。谢谢你。

POM配置:

<plugin>
 <groupId>org.codehaus.mojo</groupId>
 <artifactId>gwt-maven-plugin</artifactId>
<!-- Version 2.1.0-1 works at least with Vaadin 6.5 -->
 <version>2.3.0</version>
 <configuration>
     <!-- if you don't specify any modules, the plugin will find them -->
     <!--modules>
         ..
     </modules-->
     <webappDirectory>${project.build.directory}/${project.build.finalName}/VAADIN/widgetsets</webappDirectory>
     <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
     <runTarget>clean</runTarget>
     <hostedWebapp>${project.build.directory}/${project.build.finalName}</hostedWebapp>
     <noServer>true</noServer>
     <port>8080</port>
     <soyc>false</soyc>
 </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>2.3.0</version>
    </dependency>
    <dependency>
    <groupId>com.google.gwt</groupId>
    <artifactId>gwt-user</artifactId>
    <version>${gwt.version}</version>
    </dependency>
</dependencies>
</plugin>

下面是GWT依赖项

<dependency>
        <groupId>com.google.gwt.google-apis</groupId>
        <artifactId>gwt-visualization</artifactId>
        <version>1.0.2</version>
    </dependency>
    <dependency>
        <groupId>javax.validation</groupId>
        <artifactId>validation-api</artifactId>
        <version>1.0.0.GA</version>
    </dependency>        
    <dependency>
        <groupId>com.google.gwt.google-apis</groupId>
        <artifactId>gwt-ajaxloader</artifactId>
        <version>1.1.0</version>
    </dependency>
<dependency>
        <groupId>org.vaadin.addons</groupId>
        <artifactId>visualizationsforvaadin</artifactId>
        <version>1.1.2</version>
    </dependency>
    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-web-api</artifactId>
        <version>6.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin</artifactId>
        <version>${vaadin.version}</version>
    </dependency>
    <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-user</artifactId>
        <version>${gwt.version}</version>
    </dependency>

在过去的2天里,我一直在为此挣扎。供将来参考:

你需要什么:

<dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-client-compiler</artifactId>
        <version>${versions.vaadin}</version>
    </dependency>

按如下方式配置gwt-maven-plugin(当然,您可能不需要我使用的所有配置):

<plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>gwt-maven-plugin</artifactId>
            <version>${versions.gwt}</version>
            <configuration>
                <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
                <webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets
                </webappDirectory>
                <hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets
                </hostedWebapp>
                <noServer>true</noServer>
                <draftCompile>true</draftCompile>
                <compileReport>false</compileReport>
                <style>DETAILED</style>
                <runTarget>http://localhost:8080/</runTarget>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>resources</goal>
                        <goal>compile</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

vaadin-maven-plugin:

<plugin>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-maven-plugin</artifactId>
            <version>${versions.vaadin}</version>
            <executions>
                <execution>
                    <configuration>
                        <!--<modules>
                            <module>org.vaadin.aceeditor.AceEditorWidgetSet</module>
                        </modules>-->
                    </configuration>
                    <goals>
                        <goal>update-widgetset</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

你可能还想配置maven-clean-plugin:

<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-clean-plugin</artifactId>
            <version>2.5</version>
            <configuration>
                <filesets>
                    <fileset>
                        <directory>
                            ${basedir}/src/main/webapp/VAADIN/widgetsets
                        </directory>
                    </fileset>
                </filesets>
            </configuration>
        </plugin>

在web.xml中为servlet(以Ace Editor为例):

    <init-param>
        <param-name>widgetset</param-name>
        <param-value>org.vaadin.aceeditor.AceEditorWidgetSet</param-value>
    </init-param>

请注意,我没有在pom.xml中包含gwt作为依赖项。

我在Eclipse中有一个功能齐全的带有自定义小部件的Vaadin项目,但我在项目中找不到任何对gwt-dev的引用。转到Project properties -> Java Build Path -> Libraries并删除对gwt-dev的所有引用。也要从pom.xml中删除它,并尝试重新编译小部件集。

edit:它也可能是您的gwt-user依赖项。尝试将gwt-user的版本设置为2.3.0(如果还不是),并将范围设置为provided

相关内容

  • 没有找到相关文章

最新更新