Hi,
I am building an RPM from a gradle project using gradle ospackage plugin.
So The RPM is to include a lib folder with all the compile dependencies of the project, simple enough.
I have:
from (configurations.compile.collect()) {
into 'lib'
}
This puts a bunch of dependencies into the ‘lib’ folder in the RPM root but it includes multiple versions of some of the packages. For example, a
Something else to watch out for is that calling collect() on the configuration will cause the configuration to be resolved during Gradle’s configuration/evaluation phase. This is something that should be avoided as a general best practice.
You can use the configuration directly when calling from() and the configuration will only be resolved if the task is actually executed.
I actually had an issue whereby a dependency resolve (really a dependency substitution) wasn’t being included in a detached configuration. I therefor had to switch it to a: