现在软件国产化的需求成了刚需了,因此在实施的过程中,我们整合了宝蓝德,我将过程写一下。
1.宝蓝德提供的程序包。
包名 | 说明 |
bes-actuator-spring-boot-2.x-starter-9.5.2.jar | 监控包,可选 |
bes-gmssl | 这个是国密安全包,可选 |
bes-jasper | 支持JSP,可选 |
bes-jdbcra | 支持JDBC ,可选 |
bes-lite-spring-boot-2.x-starter-9.5.2 | 核心包,必须 |
bes-websocket | 支持 websocket |
将这些包发送到我们的私服,或者 使用 mvn install 安装到本地仓库。
2. 去掉 spring-boot-starter-web 的 tomcat依赖
<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>
在启动 jpaas-system 时,发现启动时,没有使用 宝蓝德启动,而是使用的 jetty。这个是怎么回事呢。
通过IDEA的依赖工具。
搜索 jetty ,通过依赖图,我们可以发现,依赖 jetty 的是 kettle-engine.jar ,因此,通过排除 jetty 的依赖,再启动就不会显示启动jetty 了。
<exclusions> <exclusion> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-jaas</artifactId> </exclusion> <exclusion> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-server</artifactId> </exclusion> <exclusion> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-security</artifactId> </exclusion> <exclusion> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-servlet</artifactId> </exclusion> <exclusion> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-servlet</artifactId> </exclusion> <exclusion> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-util</artifactId> </exclusion> <exclusion> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-xml</artifactId> </exclusion> <exclusion> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-webapp</artifactId> </exclusion> </exclusions>
这没多的依赖,我们是怎么找到的呢,在 idea 中,可以双击kettle-engine定位到 kettle-engine 的依赖,然后排除掉jetty的依赖包,相当的方便。
3. 在我们的程序包中增加依赖。
<dependency> <groupId>com.bes.appserver</groupId> <artifactId>bes-websocket</artifactId> </dependency> <dependency> <groupId>com.bes.appserver</groupId> <artifactId>bes-lite-spring-boot-starter</artifactId> </dependency> <dependency> <groupId>com.bes.appserver</groupId> <artifactId>bes-actuator-spring-boot-2.x-starter</artifactId> </dependency> <dependency> <groupId>com.bes.appserver</groupId> <artifactId>bes-gmssl</artifactId> </dependency>
在程序启动时会输出
表示宝蓝德整合成功。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
2015-01-11 Future 模式介绍