记录一次打包失败的原因:
异常提示如下:
Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.7.5:repackage (repackage) on project secret: Execution repackage of goal org.springframework.boot:spring-boot-maven-plugin:2.7.5:repackage failed: Unable to rename ‘D:\work space\secret\target\secret-0.0.1-SNAPSHOT.jar’ to ‘D:\work space\secret\target\secret-0.0.1-SNAPSHOT.jar.original’
反复clean、install,依旧提示同样的问题。
自信看日志发现,提示的是不能对jar包重新命名。
感觉有点像是平时重命名系统文件夹或者文件时,类似的提示。
解决问题
找到电脑任务管理器
输入java,结束当前的任务,重新打包。
可以打包成功。