Well, in principle, "exclude" is just a method that belongs to the "ModuleDependency" class, which accepts a "map" "groups" and "module", and there is no way to pass more.
However, you can use the "Groovy" power in this case and for each "group" from the list to call the "exclude" method on "ModuleDependency" and pass the current "group". Check out the sample code below.
compile() { dep -> [group1, group2].each{ group -> dep.exclude group: group } }
source share