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"/>

and

<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?

Robert

Why .svn bothers you? It is no longer used since Subversion 1.7 - http://subversion.apache.org/docs/release-notes/1.7.html#wc-ng

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

withXml

block. See http://www.gradle.org/docs/current/userguide/eclipse_plugin.html 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.