阅读量:4
- 由于最近项目需要国产化信创改造,引入东方通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
启动项目,成功啦