Importing a Gradle project ignores configuration in Gradle script
Answered
Following the example on the Gradle documentation, I'm attempting to add a JAR to the runtime scope of IntelliJ's classpath for my project.
configurations {
intelliJ
}
dependencies {
intelliJ project.files("/path/to/my.jar")
}
idea.module {
scopes.RUNTIME.plus += [ configurations.intelliJ ]
}
When I execute "./gradlew idea", the generated *.iml file contains a reference to "/path/to/my.jar". If I delete all IntelliJ metadata files and import the project using the Gradle import wizard, IntelliJ generates the metadata files but the additional dependency is not picked up. How can I get IntelliJ, when I import my project, to add this JAR to its runtime classpath via Gradle?
Please sign in to leave a comment.
Please see https://youtrack.jetbrains.com/issue/IDEA-158603#comment=27-1558600.