在pom文件中的spring-boot-maven-plugin插件加入
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
添加之后刷新pom页面即可正常cmd运行
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>