Resource already exists on disk: '/myproject/bin/META-INF/persistence.xml'

4.1k views Asked by At

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: '/myproject/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: '/myproject/bin/META-INF/logback.xml'.". And even with /myproject/bin/.gitkeep.

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 automated solution.

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

0

There are 0 answers