首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将SmartGWT 4.0示例项目迁移到Maven

将SmartGWT 4.0示例项目迁移到Maven
EN

Stack Overflow用户
提问于 2022-03-29 14:48:29
回答 1查看 141关注 0票数 3

我目前正在尝试通过smartGWT将smartGWT 4.0示例项目调用的BuiltinDS迁移到Maven,其特点如下:

2021-03

  • SmartGWT
  • Smartgwt 4.0版本-pro
  • GWT版本2.8.1
  • JDK java 1.8
  • Eclipse版本库在Nexus

F 211

这是带有我发现的依赖项的Pom。

代码语言:javascript
复制
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>builtinds</groupId>
  <artifactId>builtinds</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  
  <dependencies>
  
           <!-- Standard GWT depdendency -->
           <dependency>
               <groupId>com.google.gwt</groupId>
               <artifactId>gwt-user</artifactId>
               <version>2.8.1</version>
               <scope>provided</scope>
           </dependency>
           
            <!-- https://mvnrepository.com/artifact/com.google.gwt/gwt-servlet -->
            <dependency>
                <groupId>com.google.gwt</groupId>
                <artifactId>gwt-servlet</artifactId>
                <version>2.8.1</version>
                <scope>provided</scope>
            </dependency>
            
            <!-- https://mvnrepository.com/artifact/com.google.gwt/gwt-dev -->
            <dependency>
                <groupId>com.google.gwt</groupId>
                <artifactId>gwt-dev</artifactId>
                <version>2.8.1</version>
                <scope>provided</scope>
            </dependency>
            
            
            <!-- https://mvnrepository.com/artifact/javax.servlet/servlet-api -->
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>javax.servlet-api</artifactId>
                <version>3.1.0</version>
            </dependency>
    
           <!-- The SmartGWT Evaluation edition -->
           <dependency>
               <groupId>com.isomorphic.smartgwt.pro</groupId>
               <artifactId>smartgwt-pro</artifactId>
               <version>4.0-focuss</version>
               <exclusions>
                    <!-- Exclusion: required to avoid conflicting with the asm dependency below -->
                    <exclusion>
                        <groupId>asm</groupId>
                        <artifactId>asm</artifactId>
                    </exclusion>
                </exclusions>
           </dependency>
    
           <!-- Add support for SQLDataSources -->
           <dependency>
               <groupId>com.isomorphic.smartgwt.pro</groupId>
               <artifactId>isomorphic-sql</artifactId>
               <version>4.0-focuss</version>
           </dependency>
           
           <!-- only_for_building\log4j\log4j-1.2.15.jar -->
            <!-- https://mvnrepository.com/artifact/log4j/log4j -->
            <dependency>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
                <version>1.2.17</version>
            </dependency>
            
            <!-- https://mvnrepository.com/artifact/org.hsqldb/hsqldb --> 
            <dependency>
                <groupId>org.hsqldb</groupId>
                <artifactId>hsqldb</artifactId>
                <version>2.2.9</version>
            </dependency>   
            
            <!-- https://mvnrepository.com/artifact/commons-codec/commons-codec -->
            <dependency>
                <groupId>commons-codec</groupId>
                <artifactId>commons-codec</artifactId>
                <version>1.3</version>
            </dependency>
            
            <!-- https://mvnrepository.com/artifact/commons-collections/commons-collections -->
            <dependency>
                <groupId>commons-collections</groupId>
                <artifactId>commons-collections</artifactId>
                <version>3.2.1</version>
            </dependency>
            
            <!-- https://mvnrepository.com/artifact/commons-fileupload/commons-fileupload -->
            <dependency>
                <groupId>commons-fileupload</groupId>
                <artifactId>commons-fileupload</artifactId>
                <version>1.3</version>
            </dependency>
            
            <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-dbcp2 -->
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-dbcp2</artifactId>
                <version>2.0</version>
            </dependency>       
            
            
            <!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
            <dependency>
                <groupId>org.apache.poi</groupId>
                <artifactId>poi-ooxml</artifactId>
                <version>3.9</version>
            </dependency>
            
            <!-- Logging: Slf4j -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>1.7.7</version>
            </dependency>
        
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>1.7.7</version>
            </dependency>       
            
            <!-- https://mvnrepository.com/artifact/commons-jxpath/commons-jxpath -->
            <dependency>
                <groupId>commons-jxpath</groupId>
                <artifactId>commons-jxpath</artifactId>
                <version>1.3</version>
            </dependency>
            
            <!-- https://mvnrepository.com/artifact/oro/oro -->
            <dependency>
                <groupId>oro</groupId>
                <artifactId>oro</artifactId>
                <version>2.0.6</version>
            </dependency>
            
            <!-- https://mvnrepository.com/artifact/com.smartgwt/smartgwt-skins -->
            <dependency>
                <groupId>com.smartgwt</groupId>
                <artifactId>smartgwt-skins</artifactId>
                <version>2.5</version>
            </dependency>
            
            <!-- https://mvnrepository.com/artifact/commons-lang/commons-lang -->
            <dependency>
                <groupId>commons-lang</groupId>
                <artifactId>commons-lang</artifactId>
                <version>2.4</version>
            </dependency>
            
            <!-- https://mvnrepository.com/artifact/commons-pool/commons-pool -->
            <dependency>
                <groupId>commons-pool</groupId>
                <artifactId>commons-pool</artifactId>
                <version>1.4</version>
            </dependency>
            
            <!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
            <dependency>
                <groupId>org.apache.poi</groupId>
                <artifactId>poi</artifactId>
                <version>3.9</version>
            </dependency>   
            
            <!-- https://mvnrepository.com/artifact/org.eclipse.jetty/jetty-maven-plugin -->
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>9.4.19.v20190610</version>
            </dependency>       
    
       
    </dependencies>
       
  <build>
    <sourceDirectory>src</sourceDirectory>
    <resources>
      <resource>
        <directory>src</directory>
        <excludes>
          <exclude>**/*.java</exclude>
        </excludes>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      
      <plugin>
           <groupId>org.codehaus.mojo</groupId>
           <artifactId>gwt-maven-plugin</artifactId>
           <version>2.8.1</version>
           <executions>
                  <execution>
                      <goals>
                          <goal>compile</goal>
                      </goals>
                  </execution>
           </executions>
      </plugin>
      
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>3.0.0</version>
     </plugin>
    </plugins>
  </build>
</project>

这是BuiltInDS.gwt.xml

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.6.1//EN"
   "http://www.gwtproject.org/doctype/2.6.1/gwt-module.dtd">
<module rename-to="builtinds">
    <inherits name='com.google.gwt.user.User'/>
    <inherits name="com.smartgwt.tools.SmartGwtTools"/>
    <inherits name="com.smartgwtee.tools.Tools"/>
    <inherits name="com.smartgwtee.SmartGwtEE"/>

    <!-- Other module inherits -->
    <!-- 1) Add SmartGWT module -->
    <inherits name="com.smartgwt.SmartGwt"/>
    
    <set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE'/>
    
    <entry-point class='com.smartgwt.sample.client.BuiltInDS'/>
</module>

这是BuiltInDS.html

代码语言:javascript
复制
<!DOCTYPE html>

<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <!--                                           -->
    <!-- Any title is fine                         -->
    <!--                                           -->
    <title>BuiltInDS</title>
    
    <!-- IMPORTANT : You must set the variable isomorphicDir to [MODULE_NAME]/sc/ so that the SmartGWT resource are 
      correctly resolved -->    
    <script> var isomorphicDir = "builtinds/sc/"; </script>
    
    <!--                                           -->
    <!-- This script loads your compiled module.   -->
    <!-- If you add any GWT meta tags, they must   -->
    <!-- be added before this line.                -->
    <!--                                           -->      
    <script type="text/javascript" language="javascript" src="builtinds/builtinds.nocache.js"></script>

    <!-- The following script is required if you're running (Super)DevMode and are using module
         definitions that contain <script> tags.  Normally, this script is loaded automatically
         by builtinds.nocache.js above, but this isn't possible when (Super)DevMode is running.
         Note: it should not create any issue to always load it below (even if already loaded). -->
    <script type="text/javascript" language="javascript" src="builtinds/loadScriptTagFiles.js"></script>

    <script src="builtinds/sc/modules/ISC_Core.js"> </script>
    <script src="builtinds/sc/modules/ISC_Foundation.js"> </script>
    <script src="builtinds/sc/modules/ISC_Containers.js"> </script>
    <script src="builtinds/sc/modules/ISC_Grids.js"> </script>
    <script src="builtinds/sc/modules/ISC_Forms.js"> </script>
    <script src="builtinds/sc/modules/ISC_RichTextEditor.js"></script>
    <script src="builtinds/sc/modules/ISC_Calendar.js"> </script>
    <script src="builtinds/sc/modules/ISC_DataBinding.js"> </script>
    <script src="builtinds/sc/skins/Enterprise/load_skin.js"></script>

  </head>

  <!--                                           -->
  <!-- The body can have arbitrary html, or      -->
  <!-- you can leave the body empty if you want  -->
  <!-- to create a completely dynamic UI.        -->
  <!--                                           -->
  <body>

    <!--load the datasources-->
    <script src="builtinds/sc/DataSourceLoader?dataSource=supplyItem,animals,employees,bufferTable,bufferHistoryTable"></script>

    <!-- OPTIONAL: include this if you want history support -->
    <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>

  </body>
</html>

编译是成功的,但是当我运行(CodeServer)类型的配置时,控制台提供了以下内容,并且应用程序没有启动。

EN

回答 1

Stack Overflow用户

发布于 2022-03-31 15:40:10

几个月前,我在一个与你类似的项目上遇到了类似的问题,但没有Maven的参与。

对于我的问题,这个问题应该归咎于Eclipse版本。看来,2020-06之后的任何版本的Eclipse都无法用实际的Java 8启动Java 8- GWT项目。您正在使用的是2021-03,我建议您尝试将Eclipse降级到2020-06版本。

我用GWT 2.8.1和GWT 2.9.0在Eclipse2020-06上测试了我的项目,它们都运行得很好。

我希望我能帮上忙!

卢克

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71664239

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档