Resource already exists on disk: ‘/workx/bin/META-INF/persistence.xml’

In Eclipse 4.4 and 4.5, after a restart or a project clean, I get the following error: The project was not built due to "Resource already exists on disk: '/workx/bin/META-INF/persistence.xml'." I’m using Datanucleus 4.1.1 and Eclipse DataNucleus Enhancer plugin 4.0. I don’t have that file on my sources, as I’m relying on JPA annotations.

Sometimes I got a very similar error The project was not built due to "Resource already exists on disk: '/workx/bin/META-INF/logback.xml'.".

The workaround to fix this is to delete the /bin subfolder, refresh the project and rebuild. But this is becoming annoying and I would need a more permanent and automatic solution.

The project is using Gradle and it was imported in Eclipse as a Gradle project. I also installed Gradle IDE plugin.


Source: eclipse

Leave a Reply