I have 2 modules: A
and B
. Module B
contains /src/main/resources/file.xml
, but module A
also dependent on this file.xml at runtime. Is it possible to copy resources from module B
to module A
during build?
I've been used maven-resources-plugin
in Maven for this goal, but I can't find a similar thing for Gradle.
The solution is quite simple:
sourceSets {
main {
resources {
srcDir '../B/src/main/resources'
}
}
test {
resources {
srcDir '../B/src/main/resources'
}
}
}
Maybe there are other solutions, but it looks good to me.
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