Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse unable to clean build output

Tags:

java

xml

eclipse

I have an Eclipse (4.4.1) working set consisting of ~60 projects (the number may be relevant, as it takes more time to refresh the workspace). Occasionally, I encounter build failures because Eclipse is unable to clean the output folder before build:

Eclipse build problem

It turned out that the process which locks the file is Eclipse itself:

enter image description here

It also turned out that files being locked are always of XML content. Particularly, if I define resources with *.foo extension as XML files (via Preferences -> General -> Content Types), there's a good chance they will be locked, too, once they're copied to the output path.

I thought the problem was caused by all XML resources being validated automatically:

enter image description here

-- so I added exclusion filters 1st and even disabled XML/XSD validation entirely. The problem stopped occurring that often, but still emerges from time to time. Refreshing or closing-reopening a project isn't helpful.

The only remedy is restarting Eclipse or running Unlocker every 1/2 hour, which is not very convenient.

Any ideas how to solve or at least further diagnose this?

like image 393
Bass Avatar asked Oct 29 '14 13:10

Bass


People also ask

What is clean build in Eclipse?

It removes whatever already-compiled files are in your project so that you can do a complete fresh rebuild.


2 Answers

Just my 2 cents.

Perhaps you can fix this issue by following this steps:

  1. Project -> Properties -> Builders -> New -> Program
  2. Define a custom "Cleaner"-Program, for example Unlocker or your own Java- or CMD-script
  3. Move your custom Builder-Program up. It should be the first Builder in the list

P.S. some times i have similar problems caused by Avira Antivirus Scanner...

like image 59
dieter Avatar answered Sep 19 '22 14:09

dieter


Disable third-party version control daemons. (Like TGitCache).

They only lock resources for a short while and are not visible in Process Explorer, but are the most frequent cause of such failures.

like image 38
Basilevs Avatar answered Sep 22 '22 14:09

Basilevs