Maven clean 无法删除 MySql jar
我正在使用 MyEclipse 8.0 开发 Spring Batch 项目。最近,我将 MySQL 添加到数据库资源管理器透视图中,现在当我尝试在项目上执行“mvn clean”时,它失败了,因为它无法从目标 lib 文件夹中删除 mysql-connector-java-5.1.6.jar 。我尝试手动删除这个 jar,但我收到弹出窗口,显示它正在被其他人或程序使用。到目前为止,我发现继续的唯一方法是每次需要运行另一个测试时关闭 MyEclipse。我使用的任何其他数据库 (DB2) 都不会出现此问题。
I'm using MyEclipse 8.0 to develop a Spring Batch project. Recently, I added MySQL to the database explorer perspective and now when I try to do "mvn clean" on my project, it fails because it can't delete the mysql-connector-java-5.1.6.jar from the target lib folder. I've tried manually deleting this jar, but I get that popup that says it's being used by another person or program. So far, the only way I've found to continue is to close MyEclipse every time I need to run another test. This problem doesn't occur with any other database I'm using (DB2).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有时,Windows 资源管理器不会释放目标目录中内容的文件锁。尝试使用 Process Explorer 查看锁定该文件的内容。如果不重要的话,您可以使用它来释放锁。之后,你的 mvn clean 就会正常运行。
Sometimes windows explorer doesn't release file locks on things in the target directory. Try using Process Explorer to see what has a lock on the file. You can then use it to release the lock if it's something that doesn't matter. After that, you mvn clean will run fine.
好吧,无论好坏,事实是该文件被另一个进程锁定并且删除失败。配置数据库资源管理器时,请尝试使用本地存储库中的 MySQL jar,而不是目标目录中的 MySQL jar。这应该可以解决你的问题。
Well, good or bad, the fact is that the file is locked by another process and the delete fails. When configuring the database explorer, try to use the MySQL jar from your local repository instead of the one in the target directory. This should solve your problem.