Skip to content

Instantly share code, notes, and snippets.

Last active Mar 30, 2018
What would you like to do?
Gradle IDEA add project dependencies instead of JAR dependencies in Intellij configuration file (.iml)
apply plugin: 'idea'
idea.module.iml {
def customDependencies = ['org.objectweb.proactive', 'org.ow2.proactive']
whenMerged { module ->
// to reorder dependencies
def existingDependencies = module.dependencies
module.dependencies = new LinkedHashSet()
configurations.compile.resolvedConfiguration.resolvedArtifacts.each {
if ( == || customDependencies.contains( ) {"Custom idea: adding ${}")
module.dependencies.add(new org.gradle.plugins.ide.idea.model.ModuleDependency(, 'COMPILE'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment