最近公司的的产品需要用国产化组件,我们的项目原来使用的是springboot内置的tomcat,需要用tongweb做替换。
1.首先tongweb不是免费的,需要向东方通购买
2.通过东方通提供的压缩包(我们的版本是TongWeb8.0.E.1),我们先打开
001_TongWeb_V8.0嵌入式版_JavaEE标准容器用户指南_80E1A01.pdf
3.1 按照使用说明书先安装资源jar包,按照说明书一步一步执行
3.2 修改pom文件
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>com.tongweb.springboot</groupId> <artifactId>tongweb-spring-boot-starter-2.x</artifactId> <version>${tongweb.version}</version><!--具体的tongweb版本--> </dependency>
<!-- websocket引入 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-websocket</artifactId> </dependency> <dependency> <groupId>com.tongweb.springboot</groupId> <artifactId>tongweb-spring-boot-websocket-2.x</artifactId> <version>${tongweb.version}</version> </dependency>
其他功能按需引入
3.3 配置授权文件
把license.dat文件放到 ”工程/resources“目录下
yml文件新增配置
server: port: 8090 tongweb: license: type: file path: classpath:license.dat
4.mvn clean package打包
5.java -jar ***.jar 启动成功就说明替换完成!