I would like to output a jar which internally contains my dependency jar but overrides a particular file in the dependency jar with my own. I am using gradle build. Can someone help me with this? The task which build jar for me:
jar {
archiveName "JarName-${version}.jar"
dependsOn configurations.runtime
from {
(configurations.runtime - configurations.provided).collect {
it.isDirectory() ? it : zipTree(it)
}
}
}
Asked
Active
Viewed 642 times
0

Srikant Aggarwal
- 57
- 6
1 Answers
0
Well I actually stopped duplicating the file by including the following strategy: duplicatesStrategy = DuplicatesStrategy.EXCLUDE
It seems like my changes becomes a part of the output jar before they are being overridden by the file in my dependency jar. So, restricting duplicacy helped in resolving the issue.

Srikant Aggarwal
- 57
- 6