今天工作遇到个小插曲,springboot打jar老是报错:No auto configuration classes found in META-INF/spring.factories。下午一直没搞定,晚上回来再看就灵光一闪,果然得放松一下再处理问题。记录一下自己遇到的坑,希望也能帮助看到帖子的人!
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ankang.hospital</groupId>
<artifactId>operation</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<!-- 可以在这里添加其他属性 -->
<spring-boot.version>2.3.5.RELEASE</spring-boot.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<!-- 使用属性来管理Spring Boot版本 -->
<version>${spring-boot.version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.16</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents.client5</groupId>
<artifactId>httpclient5</artifactId>
<version>5.1.3</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<configuration>
<fork>true</fork>
<mainClass>com.ankang.hospital.HospitalApplication</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
02-27
4万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
12-12
4093
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
07-20
1万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)