How to pass gradle parameter on IntelliJ sync

Viewed 1131

EDIT:

Turns out it was not a bug but misconfiguration on my part.

Original question

Due to this bug in IntelilJ I have to add

configurations {
    all {
        exclude(group = "ch.qos.logback", module = "logback-classic")
    }
}

during IntelliJ gradle sync and then not forget to remove it.

Is there a way to pass a param to gradle on IntelliJ sync? I'd be able to have something like this:

if (project.hasProperty("intellijHack"))
    configurations {
        all {
            exclude(group = "ch.qos.logback", module = "logback-classic")
        }
    }
1 Answers

Passing command line options to IDE gradle importer process directly in IDE is not yet supported (only possible to a Gradle task Run Configuration with the 'Script parameters' field). Please vote and follow this request.

It should work with the gradle.properties file, though this property will also be honored by Gradle, launched from the command line.

Related