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

idea plguin: Resources should be added as module dependencies

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

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

Description

I have a unit test that load a resource using using ..class.getResource(). The resource is in the src/test/resources folder. When running the unit test using gradle it works as expected.
When I generate a idea module from my gradle file then the resource folder is added as a source folder and that seems fair. But when I run the unit test from within IntelliJ (a IntelliJ run configuration) then the test fails since src/test/resources is not in the module dependencies.
I have fixed it by doing this:

idea {
module { scopes.TEST.plus+= configurations.detachedConfiguration(dependencies.create(files('src/test/resources'))) scopes.RUNTIME.plus+= configurations.detachedConfiguration(dependencies.create(files('src/main/resources'))) }
}
That will add the module dependencies that I need to run my test. It also fixes the similar problem for runtime dependencies.

I think the resources folders should be included as dependencies by default.

Activity

  • All
  • Comments
  • History
  • Activity
  • TeamCity
  • Commits
  • Source
  • Reviews
There are no comments yet on this issue.

People

  • Assignee:
    Unassigned
    Reporter:
    Tobias Tobiasen
Vote (0)
Watch (1)

Dates

  • Created:
    31/May/12 3:06 AM
    Updated:
    31/May/12 3:06 AM
  • 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.