Eclipse "Updates Automatically" and Maven Interferences

I recently set up Eclipse (version 3.6) to automatically update projects in my workspace (Windows> Preferences> General> Workspace> Automatically Update).

Since I changed this configuration, I have the following problem when I try to start Maven (install Maven from Eclipse) to create a large project:

[ERROR] Failed to fulfill the target org.apache.maven.plugins: maven-clean-plugin: 2.4.1: clean (default-clean) in the project ProjectName: failed to clean up the project: failed to delete C: \ ProjectName \ target → [Help 1] [ERROR] [ERROR] To see the complete error stack error, rerun Maven with the -e switch. [ERROR] Restart Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about errors and possible solutions, see the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

The problem arises randomly (more or less 50% of the time when I build one project), but when I try to collect all 14 projects, I always get this error somewhere. I think the problem is that Maven is trying to delete files blocked by Eclipse (this is a project update). In fact, this does not happen when I turn off the "Update automatically" option.

Does anyone know a trick to avoid this problem?

I noticed that there is another question: Eclipse will automatically update resources and exclude the dir assembly about this topic, but there are no answers. I hope I have provided enough information to understand the problem.

+4
source share
2 answers

This is because something, most likely an eclipse, has a file lock during the update, so when maven tries to clear (i.e. delete the target directory), it fails. Do not update automatically; For me, usually only eclipse updates the workspace when it is initially running.

+1
source

I think this was a bug in Eclipse in an earlier version, since it should not block any files inside the target folder.

I had this problem in front of me, but I have not encountered in recent years. Therefore, if you do, add an error to https://bugs.eclipse.org/bugs/ against m2e or whatever might be more appropriate.

0
source

All Articles