eladmin如何实现与宝蓝德BES兼容

在网上找了一圈没有一个eladmin适配宝蓝德的方法,所以自己琢磨了一下,关键是将多模块的打包方式改为war,其他的没别的

1、将多模块项目打包方式改为war包方式

主运行模块里pom.xml

	<packaging>war</packaging>

2、父项目中从spring-web里剔除tomcat

 <!-- 移除嵌入式tomcat插件 -->
  <exclusions>
      <exclusion>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter-tomcat</artifactId>
      </exclusion>
  </exclusions>

3、主类AppRun里调整构建方式为war

继承SpringBootServletInitializer

extends SpringBootServletInitializer

添加此部分代码

  @Override
  protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
      return builder.sources(AppRun.class);
  }

4、添加fit2cloud的镜像库(不确定是否需要爬梯)

    <repository>
			<id>public2</id>
			<url>https://repository.fit2cloud.com/content/groups/public/</url>
			<releases>
				<enabled>true</enabled>
			</releases>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
	</repository>

5、引入宝蓝德web jar包,其余包可按需要引入

		<dependency>
		    <groupId>com.bes.appserv-web</groupId>
		    <artifactId>bes-actuator-spring-boot-2.x-starter</artifactId>
		    <version>9.5.5</version>
		</dependency>

其他常用jar包有:

<!-- 提供国密服务,选择性引入 -->
 
<dependency>
 
 <groupId>com.bes.besstarter</groupId>
 
 <artifactId>bes-gmssl</artifactId>
 
 <version>9.5.2</version>
 
</dependency>
 
<!-- 提供jsp服务,选择性引入 -->
 
<dependency>
 
 <groupId>com.bes.besstarter</groupId>
 
 <artifactId>bes-jasper</artifactId>
 
 <version>9.5.2</version>
 
</dependency>
 
<!-- 提供数据源服务,选择性引入-->
 
<dependency>
 
 <groupId>com.bes.besstarter</groupId>
 
 <artifactId>bes-jdbcra</artifactId>
 
 <version>9.5.2</version>
 
</dependency>
 
<!-- 提供websocket服务,选择性引入-->
 
<dependency>
 
 <groupId>com.bes.besstarter</groupId>
 
 <artifactId>bes-websocket</artifactId>
 
 <version>9.5.2</version>
 
</dependency>

6、添加spring-tomcat依赖包里引入过的javax.servlet-api以及javax.websocket包,不引入会报错

	<dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
    </dependency>

	<dependency>
		    <groupId>javax.websocket</groupId>
		    <artifactId>javax.websocket-api</artifactId>
		    <scope>provided</scope>
	</dependency>

7、在主类runApp中将eladmin架构里自带的对于tomcat URL解析异常处理的代码去除,否则会报错

8、部署

maven install

生成war包

  • 8
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值