What is the syntax to exclude dependencies when using the map notation?

Neither user doc nor api doc seems to address this… my best intuitive guess doesn’t work (incorrect guess provided below for context):

dependencies {

compile(

[group: “commons-beanutils”, name: “commons-beanutils”, version: “1.7.0”, exclude: module=“commons-logging”],

) }

It’s…

dependencies {
   compile(group: "commons-beanutils", name: "commons-beanutils", version: "1.7.0") {
     exclude module: "commons-logging"
  }
 }

It’s kind of explained here: http://gradle.org/current/docs/javadoc/org/gradle/api/artifacts/dsl/DependencyHandler.html

But I admit it’s not exactly jumping out of the docs.

BTW, on the forums if you wrap code in <code> tags then you will get syntax highlighting and whitespace preservation.

Thanks for the response, however it doesn’t ansewr my question because I’m asking about the syntax of the map-style notation, i.e.

dependencies: {
  compile(
    [group: "commons-beanutils", name: "commons-beanutils", version: "1.7.0"]
  )
}

(see example 194 here)

The map notation makes for very readable code because I don’t have to call compile() 20 times for 20 dependencies. However the example of that notation doesn’t show how an exclude would be specified.

You actually can’t use map notation to define multiple, you can only do that with strings. Can you point me to where you saw this?

Really? It’s working for me.

I followed example 194 on http://www.gradle.org/dependency_management.html and I have a working sample with 20 dependencies enclosed in the compile() call.

But setting that aside for the moment, whether it is single or multiple, what is the syntax to exclude when using the map notation?

Right, now I understand.

A quick read of the code says that there is currently no way to express excludes with the multiple map syntax unfortunately. It does work when you are only using one map though.

Feel free to raise a feature request at http://issues.gradle.org if you want some way to specify excludes with this syntax.

Actually, a quick read of the code says that that actually doesn’t work.

It looks like there is currently no way to express excludes with the multiple map syntax unfortunately. It does work when you are only using one map though.