[GRADLE-1884] gradle eclipseClasspath should add output directory of build/classes by default, not bin Created: 02/Nov/11  Updated: 04/Jan/13  Resolved: 15/Mar/12

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-milestone-5
Fix Version/s: None

Type: Bug
Reporter: Tim Myer Assignee: Unassigned
Resolution: Won't Fix Votes: 0


Given the following build.gradle file:

apply plugin: 'groovy'
apply plugin: 'eclipse'

When I run 'gradle eclipseClasspath'

Then I get the following .classpath file:
<?xml version="1.0" encoding="UTF-8"?>
<classpathentry kind="output" path="bin"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER" exported="true"/>

I expect that my .classpath file should be consistent with gradle, i.e., that my IDE should compile my groovy files to the directory where gradle compiles my groovy files (similar to what the m2e plugin does for maven/eclipse integration). I would expect my .classpath file to look like this:
<classpathentry kind="output" path="build/classes"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER" exported="true"/>

Comment by Jayson Workman [ 21/Feb/12 ]

A workaround would be to override the defaultOutputDir:

eclipse {
classpath {
defaultOutputDir = file('build/classes/main')

Comment by Tim Myer [ 21/Feb/12 ]

Thanks Jayson. I will give it a try.

Comment by Szczepan Faber [ 15/Mar/12 ]

Sharing the build folder is problematic because one cannot run command line build and work in the IDE in the same time. For example, when you run gradle clean build from the command line, eclipse IDE will not work properly until the classes have been compiled.

Personally, I much more prefer separate build folders for convenient multi-tasking. You can always configure the build output folder via eclipse DSL configuration as was already suggested.

I'm closing the issue because the new default value you suggested is not necessarily better for all use cases

Generated at Wed Jun 30 12:06:57 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.