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

首先移除springboot自带的tomcat依赖,并添加tongweb所需依赖
- <!-- SpringBoot Web容器 -->
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-web</artifactId>
- <!--排除自带的tomcat依赖-->
- <exclusions>
- <exclusion>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-tomcat</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <!-- 添加tongweb-spring-boot-starter依赖 -->
- <dependency>
- <groupId>com.tongweb.springboot</groupId>
- <artifactId>tongweb-spring-boot-starter-2.x</artifactId>
- <version>7.0.E.6_P7</version>
- </dependency>
- <!-- 添加tongweb其他依赖 -->
- <dependency>
- <groupId>com.tongweb</groupId>
- <artifactId>tongweb-embed-core</artifactId>
- <version>7.0.E.6_P7</version>
- </dependency>
- <dependency>
- <groupId>com.tongweb</groupId>
- <artifactId>tongweb-embed-el</artifactId>
- <version>7.0.E.6_P7</version>
- </dependency>
- <dependency>
- <groupId>com.tongweb</groupId>
- <artifactId>tongweb-javax-annotation</artifactId>
- <version>1.2.1</version>
- </dependency>
- <dependency>
- <groupId>com.tongweb</groupId>
- <artifactId>tongweb-lic-sdk</artifactId>
- <version>4.5.0.0</version>
- </dependency>
- <!-- 添加javax.servlet依赖(移除tomcat导致) -->
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
- <version>4.0.1</version>
- </dependency>
复制代码 在resources目录下上传license.dat文件,如图所示

修改application.yml配置文件中的“tomcat”改为“tongweb”,并增加license配置
- server:
- tongweb:
- uri-encoding: UTF-8
- license:
- type: file
- path: classpath:tongweb/license.dat
复制代码
启动项目,乐成啦
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |