Gradle eclipse generates multiple classpath entries for source folder

Trying to update an existing Eclipse .classpath with gradle’s eclipse task, I get duplicate source entries when the old source entry had an excluding attribute. Eclipse then complains that the build path contains duplicate entry ‘src’.

The original entry was

<classpathentry excluding="**/.DS_Store*|**/.svn/*" kind="src" path="src"/>

and after gradle eclipse I have

<classpathentry excluding="**/.DS_Store*|**/.svn/*" kind="src" path="src"/>


<classpathentry kind="src" path="src"/>

I understand that I can have gradle run cleanEclipseClasspath and avoid the problem, but then it loses my exclude settings above.

What am I missing here?


Why .svn bothers you? It is no longer used since Subversion 1.7 -

Similar with .DS_Store: I think you do not have them in your SCM. How would they be created then to cause a big pain.

Anyway to fix your problem you will probably need to tinker generated XML in eclipse customization for your project inside


block. See and linked documentation.

Yes, the settings are old and I don’t need .svn anymore. No, .DS_Store is not in the SCM, but it’s still in the list of excluded folders for Eclipse. But you are missing the point. The question is not why I want to exclude what. The question is why the eclipse plugin cannot handle these valid settings and generates an invalid .classpath file.