Gradle

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
To raise new issues or bugs against Gradle, please use forums.gradle.org.
  • Gradle
  • GRADLE-1766

A dependecy on sourceset.classes breaks GradleDependencies classpath container in Eclipse/STS

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Open Open
  • Resolution: Unresolved
  • Affects Version/s: 1.0-milestone-3
  • Fix Version/s: None

Description

Problem manifests itself in this project http://static.springsource.org/spring-security/site/source.html

When this project is imported into STS Gradle tooling, it produces an invalid classpath for some of the subprojects.
The error is as follows:

msg :The container 'Gradle Dependencies' references non existing library '.../spring-security/core/build/classes/test' project: spring-security-web

This message seems to be caused by the following lines in the projects buid file:

dependencies {
    ...
    testCompile project(':spring-security-core').sourceSets.test.classes,
                ...
}

Workaround, replace the above with

dependencies { ... testCompile project(':spring-security-core'), ... }

Issue Links

Duplicated by

Bug - A problem which impairs or prevents the functions of the product. GRADLE-1116 IDEA/Eclipse plugins should replace all classpath references to a project's classes/test classes directory with a project dependency

  • Open - The issue is open and ready for the assignee to start work on it.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • History
  • Activity
  • TeamCity
  • Commits
  • Source
  • Reviews
Hide
Permalink
Kris De Volder added a comment - 25/Aug/11 6:36 PM

I can see two ways forward towards fixing this problem. The easiest is probably to aproximate dependencies like these as dependencies on the project that contains the respective source set.

Another possiblity is that Gradle tooling api provide information on output folders associated with source folders (currently no such information is provided, so I'm setting all output folder to the Eclipse default).

Then ensure that sourceSet.classes returns the same output folder as was associated with the sourcefolder.

I'm not so sure how well this will work in Eclipse, I don't think it is generally a good idea to have one project depend on binary class folder in another project. This tends to lead to problem with build mechanics/ordering and trouble associating source code with the class files.

So I think remapping it as a project dependency is probably best.

Show
Kris De Volder added a comment - 25/Aug/11 6:36 PM I can see two ways forward towards fixing this problem. The easiest is probably to aproximate dependencies like these as dependencies on the project that contains the respective source set. Another possiblity is that Gradle tooling api provide information on output folders associated with source folders (currently no such information is provided, so I'm setting all output folder to the Eclipse default). Then ensure that sourceSet.classes returns the same output folder as was associated with the sourcefolder. I'm not so sure how well this will work in Eclipse, I don't think it is generally a good idea to have one project depend on binary class folder in another project. This tends to lead to problem with build mechanics/ordering and trouble associating source code with the class files. So I think remapping it as a project dependency is probably best.
Hide
Permalink
Kris De Volder added a comment - 25/Aug/11 6:37 PM

Classified as minor issue because there is a relatively easy workaround.

Show
Kris De Volder added a comment - 25/Aug/11 6:37 PM Classified as minor issue because there is a relatively easy workaround.
Hide
Permalink
Rob Winch added a comment - 27/Aug/11 2:07 PM - edited

I'm not sure I consider this minor because, unless I am missing something, the workaround will break the actual gradle build. I believe this issue may be related to GRADLE-1116

Show
Rob Winch added a comment - 27/Aug/11 2:07 PM - edited I'm not sure I consider this minor because, unless I am missing something, the workaround will break the actual gradle build. I believe this issue may be related to GRADLE-1116
Hide
Permalink
Adam Murdoch added a comment - 04/Sep/11 6:42 PM

I think we should map this as a project dependency.

Show
Adam Murdoch added a comment - 04/Sep/11 6:42 PM I think we should map this as a project dependency.

People

  • Assignee:
    Unassigned
    Reporter:
    Kris De Volder
Vote (3)
Watch (1)

Dates

  • Created:
    25/Aug/11 6:30 PM
    Updated:
    13/Apr/12 6:39 PM
  • Atlassian JIRA (v5.0.3#729-sha1:bf569e4)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Gradle. Try JIRA - bug tracking software for your team.