Maven打包失败:repackage failed: Unable to rename

记录一次打包失败的原因:

异常提示如下:

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,结束当前的任务,重新打包。
可以打包成功。

猜你喜欢

转载自blog.csdn.net/qq_38254635/article/details/131724830