The pom.xml of dependency is describle with <packaging>apk</packaging>
,which isn't workable in compile.
So I exclude the module in dependency tree and re-include by
compile 'package:artifactId:versionName@jar'
This does work,but what's the corresponding format of group:'groupName',name:'artifactId',version:'versionName',type:'type'
?
I triedtype:'jar'
which didn't work.
And do I have to exclude the dependency in dependency tree first , then re-include it second ? Or I can modify the description of parent dependency ?
parent dependency:
compile (group:'parentGroupId',name:'parentModuleName',version:'parentVersion'){
exclude group:'excludeGroupId',module:'excludeModuleName'
}
compile 'excludeGroupId:excludeModuleName:excludeVersion@jar'
I tried
compile (group:'parentGroupId',name:'parentModuleName',version:'parentVersion'){
exclude group:'excludeGroupId',module:'excludeModuleName'
}
compile (group:'excludeGroupId',name:'excludeModuleName',version:'excludeVersion',type:'jar')
the above didn't work
Based on the docs at http://www.gradle.org/docs/current/dsl/org.gradle.api.artifacts.dsl.DependencyHandler.html this looks like the correct way to specify this sort of dependency:
compile (group:'excludeGroupId',name:'excludeModuleName',version:'excludeVersion') {
artifact {
name = 'excludeModuleName'
type = 'jar'
}
}
Note that the redundant name
spec inside artifact
is required -- you'll get a NullPointerException
without it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With