Springboot工程

注意:非所有工程都需要,只有用到tomcat才需要,适配前检查是否含tomcat依赖

pom文件

    <profiles>
        <profile>
            <id>tongweb</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <dependencies>
                <!-- 特定依赖,只有当指定 profile 时才引入 -->
                <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-websocket-2.x</artifactId>
                     <version>8.0.E.2</version>
                </dependency>
                <dependency>
                    <groupId>com.tongweb.springboot</groupId>
                    <artifactId>tongweb-spring-boot-starter-2.x</artifactId>
                    <version>8.0.E.2</version>
                </dependency>
            </dependencies>
        </profile>
    </profiles>

本地测试

引入license.dat

不要提交到代码中

勾选profiles

验证

部署

非all in one项目可不指定-t (推荐不指定)

pai image publish -n 工程名称  -b 分支 -t 镜像版本 -P tongweb

all in one项目, 多profile用逗号隔开,且必须指定-t!!!

pai image publish -n 工程名称  -b 分支 -t 镜像版本 -P tongweb,项目profile

配置字典增加证书配置

工程动态挂载

设置镜像

启动验证

适配问题

端口号

tongweb的默认端口号为8088,如需调整为8080,请在共享配置中设置

server:
  port: 8080
文档更新时间: 2024-09-10 16:47   作者:伍润源