当前位置:   article > 正文

springboot2集成东方通tongweb嵌入式版_tongweb-spring-boot-starter-2.x

tongweb-spring-boot-starter-2.x
  • 由于最近项目需要国产化信创改造,引入东方通tongweb
  1. 联系东方通厂家 ,将依赖导入到maven仓库,并获取嵌入式版license文件
  2. 修改pom.xml,引入依赖,注意springboot版本,这里以springboot2举例

首先移除springboot自带的tomcat依赖,并添加tongweb所需依赖

  1. <!-- SpringBoot Web容器 -->
  2. <dependency>
  3. <groupId>org.springframework.boot</groupId>
  4. <artifactId>spring-boot-starter-web</artifactId>
  5. <!--排除自带的tomcat依赖-->
  6. <exclusions>
  7. <exclusion>
  8. <groupId>org.springframework.boot</groupId>
  9. <artifactId>spring-boot-starter-tomcat</artifactId>
  10. </exclusion>
  11. </exclusions>
  12. </dependency>
  13. <!-- 添加tongweb-spring-boot-starter依赖 -->
  14. <dependency>
  15. <groupId>com.tongweb.springboot</groupId>
  16. <artifactId>tongweb-spring-boot-starter-2.x</artifactId>
  17. <version>7.0.E.6_P7</version>
  18. </dependency>
  19. <!-- 添加tongweb其他依赖 -->
  20. <dependency>
  21. <groupId>com.tongweb</groupId>
  22. <artifactId>tongweb-embed-core</artifactId>
  23. <version>7.0.E.6_P7</version>
  24. </dependency>
  25. <dependency>
  26. <groupId>com.tongweb</groupId>
  27. <artifactId>tongweb-embed-el</artifactId>
  28. <version>7.0.E.6_P7</version>
  29. </dependency>
  30. <dependency>
  31. <groupId>com.tongweb</groupId>
  32. <artifactId>tongweb-javax-annotation</artifactId>
  33. <version>1.2.1</version>
  34. </dependency>
  35. <dependency>
  36. <groupId>com.tongweb</groupId>
  37. <artifactId>tongweb-lic-sdk</artifactId>
  38. <version>4.5.0.0</version>
  39. </dependency>
  40. <!-- 添加javax.servlet依赖(移除tomcat导致) -->
  41. <dependency>
  42. <groupId>javax.servlet</groupId>
  43. <artifactId>javax.servlet-api</artifactId>
  44. <version>4.0.1</version>
  45. </dependency>

在resources目录下上传license.dat文件,如图所示

修改application.yml配置文件中的“tomcat”改为“tongweb”,并增加license配置

  1. server:
  2. tongweb:
  3. uri-encoding: UTF-8
  4. license:
  5. type: file
  6. path: classpath:tongweb/license.dat

启动项目,成功啦

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop】
推荐阅读
相关标签
  

闽ICP备14008679号