I am trying to use the Gradle Eclipse plug-in to build the .classpath file for an Eclipse project. By default, it looks like everything in the compile configuration is written to .classpath. For me, that is far too much, so I created configurations that contain the dependencies that I do and do not want in the .classpath file and then used those to construct the compile configuration, like this:
… // Add what’s needed (not shown)
mustNotBeInDotClasspath … // Add what’s needed (not shown)
My eclipse task is configured like this:
minusConfigurations += configurations.compile
plusConfigurations += configurations.needToBeInDotClasspath
This does not work – the entries from the configuration “needToBeInDotClasspath” are not written to the .classpath file. I am guessing this is because they appear in both “compile” and “needToBeInDotClasspath” and the minus is overriding the “plus”. Is there any way around this? I only want the class path entries from “needToBeInDotClasspath” to appear in the file, not anything extra that the Java plug-in might have added to the compile configuration.