Search code examples
maven-2antmyeclipse

Maven clean can't delete MySql jar


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).


Solution

  • 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.