打开debug看了看
MyBatis: No MyBatis mapper was found in '[xx.mapper]' package. Please check your configuration.
找不到mapper。
而且jar包很大,100多m
之前的build
<build>
<finalName>music_academy</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!-- <version>2.5.2</version>-->
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<fork>true</fork> <!--重要-->
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
<mainClass>com.music.main.MainApplication</mainClass>
</configuration>
</plugin>
</plugins>
</build>
之后添加了<classifier>exec</classifier>
解决
<build>
<finalName>music_academy</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!-- <version>2.5.2</version>-->
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<configuration>
<fork>true</fork> <!--重要-->
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
<mainClass>com.music.main.MainApplication</mainClass>
</configuration>
</plugin>
</plugins>
</build>
并且打包之后只有40多m