We depend on orientdb-graphdb, which unfortunately has a hard dependency on gremlin-groovy. We don’t want to include Groovy with our application, mostly because it is a crap language and we don’t want to deal with support issues from users trying to use it and not being able to figure it out.
So our dependency on orientdb-graphdb excludes it:
orientdb_graphdb: ['com.orientechnologies:orientdb-graphdb:2.1.19', {
exclude group: 'com.tinkerpop.gremlin', module: 'gremlin-groovy'
}],
Now the problem is, I found it was still getting pulled in, because some other module of ours was depending on orientdb-distributed, which depends on orientdb-graphdb. For some reason - the exclude rules for orientdb-graphdb are not used in this situation. (IMO, this is crap and the exclude should apply since it’s the same dependency! But okay, I’m trying to work around it.)
I’m having trouble figuring out how I can override this sort of second-level dependency.
Something like this would reflect the kind of thing I’ve seen in the docs:
orientdb_distributed: ['com.orientechnologies:orientdb-distributed:2.1.19', {
module('com.orientechnologies:orientdb-graphdb:2.1.19') {
exclude group: 'com.tinkerpop.gremlin', module: 'gremlin-groovy'
}
}],
But it gives an error about module
being undefined. Certainly when I look at the Javadoc, the method is missing from those docs, but then again, so are half the other methods Gradle lets me call with no issue.
Is there a way to do this then? I mean, other than cracking open their POM, removing the dependency and reuploading it as a new version…