You'll have to repeat { transitive = false }
for each project dependency. Alternatively, you can make the whole configuration non-transitive (configurations.configurationName { transitive = false }
).
How can I add multiple project dependencies to a configuration in one instruction in gradle
-
21-06-2023 - |
سؤال
I am trying to add multiple project in one instruction dependencies (to use only one configuration closure) with gradle but I don't know how to do it.
If try to do
configurationName (
project('subProject1') ,
project('subProject2'),
) {
transitive = false
}
I got an error at the configuration step, but
configurationName (
project('subProject1') ,
) {
transitive = false
}
configurationName (
project('subProject2') ,
) {
transitive = false
}
I don't know why, when
configurationName(
[group: 'commons-dbutils', name: 'commons-dbutils', version: '1.5'],
[group: 'org.springframework', name: 'spring-tx', version: springVersion],
'org.apache.commons:commons-collections4:4.0'
)
works perfectly.
المحلول
لا تنتمي إلى StackOverflow