本地TongWeb7部署web的前提是,本地能启动TongWeb7(Windows),具体的教程下面给出教程
<packaging>war</packaging>

代码贴上
- @EnableAsync
- @SpringBootApplication
- @Import(ServerRuntimeBootstrap.class)
- public class NoticeServerBootstrap extends SpringBootServletInitializer {
-
- public static void main(String[] args) {
- SpringApplication.run(NoticeServerBootstrap.class, args);
- }
-
- @Override
- protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
- return application.sources(NoticeServerBootstrap.class, ServletContainerDeployment.class);
- }
- }
做这步主要是怕,内置的tomcat对接下的启动有影响。
我去除后发现,我有用到过滤器的地方都会报错(影响到程序内部结构了!),我就没做这步,也启动成功了。

- <!-- 去除内嵌tomcat -->
- <exclusions>
- <exclusion>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-tomcat</artifactId>
- </exclusion>
- </exclusions>
开始打包,打包效果如图。

访问地址:http://localhost:9060/console
进入到这里

选择你构建好的war包

点击开始部署即可。
等待一会,会返回给你部署成功还是失败。

如果部署失败的话。可以在两个地方看日志
一个是这里

不过我感觉一般不在这里看日志,格式太难看了。
一个是这里
我一般使用这种。
部署成功访问地址:
http://[::1]:8088/xxxx-server/


在弄本地TongWeb7部署web(SpringCloud)项目(Windows)得时候,我也碰到好多问题,我会在接下来的专栏里,把我遇到的问题都跟大家分享。
博主新推出的gitee免费开源项目(商城+APP+小程序+H5),有兴趣的小伙伴可以了解一下。