[GRADLE-253] Eclipse task treats resources as source folders Created: 03/Oct/08  Updated: 04/Jan/13  Resolved: 09/May/11

Status: Resolved
Project: Gradle
Affects Version/s: 0.4
Fix Version/s: None

Type: Improvement
Reporter: Levi Hoogenberg Assignee: Unassigned
Resolution: Won't Fix Votes: 1


 Description   

When doing a

gradle eclipse

a .classpath is being generated that contains the line

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

This causes Eclipse to copy all resources to build/classes, which is unnecessary. If the eclipse task would generate

<classpathentry kind="lib" path="src/main/resources"/>

instead, Eclipse would treat the resources directory as a class folder and everything (including using Gradle to generate a JAR file) would work as well.



 Comments   
Comment by Levi Hoogenberg [ 06/Oct/08 ]

Note that class folders would have to be defined after output folders, otherwise resources copied by the Resources task(s) take precedence over the original files.

Comment by Hans Dockter [ 27/Jul/10 ]

The drawback of using classpath for resources is that exclude/include patterns can't be used. We should discuss this issue on the dev list. The good news is that you can fully customize this now. So you can tell the EclipseClasspath task to remove the source folder and add a classpath entry for resources. We do this in the Gradle build itself (as we have Java sources in one of the resources dir which should not be compiled).

Comment by Szczepan Faber [ 09/May/11 ]

Another drawback of using classpath for resources is that it makes them harder to browse in Eclipse. The 'referenced libraries' container is usually quite big due to number of dependencies.

Given above, we would prefer to keep eclipse plugin creating source folders. It is also consistent with how IDEA plugin works. Sorry

Generated at Wed Jun 30 11:25:29 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.