JPAAS整合宝蓝德

现在软件国产化的需求成了刚需了,因此在实施的过程中,我们整合了宝蓝德,我将过程写一下。

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>

在程序启动时会输出

表示宝蓝德整合成功。

原文地址:https://www.cnblogs.com/yg_zhang/p/15790477.html