关于BladeX-master打war包的报错的问题,请务必尽快解决,谢谢!
请注明详细配置文档,非常感谢!
下面是boot版本单个服务打包的教程,参考下。
添加tomcat依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
2.blade-core-boot排除undertow依赖
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-core-boot</artifactId>
<exclusions>
<exclusion>
<groupId>org.springblade</groupId>
<artifactId>blade-core-cloud</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</exclusion>
</exclusions>
</dependency>
3.pom文件修改打包类型为war
<groupId>org.springblade</groupId>
<artifactId>BladeX-Boot</artifactId>
<packaging>war</packaging>
<version>2.8.2.RELEASE</version>
4.添加war包插件
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<!--如果想在没有web.xml文件的情况下构建WAR,请设置为false。-->
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
5.application.yaml添加修改
#服务器配置
server:
port: 80
spring:
application:
name: blade-api
profiles:
active: dev
main:
allow-bean-definition-overriding: true
6.Application类修改
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.scheduling.annotation.EnableScheduling;
/**
* 启动器
*
* @author Chill
*/
@EnableScheduling
@SpringBootApplication
public class Application extends SpringBootServletInitializer {
public static void main(String[] args) {
System.out.printf("----启动中----");
SpringApplication.run(Application.class, args);
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(Application.class);
}
}
7.打包
mvn package -Dmaven.test.skip=true
BladeCloud版本按照以上步骤将blade-auth服务打war包,可以打成功,但是运行报错。使用2.8.2商业授权版,windows,tomcat8.5.66。
报错信息:
扫一扫访问 Blade技术社区 移动端