We have a strange issue where randomly and infrequently, the compileJava task which deletes the META-INF folder and compiled classes to start, runs but the processResources task reports up-to-date, even though the META-INF directory clearly doesn't exist.
This bites us big time because it's possible that the artifacts make it all the way to production without an applicationContext.xml!
It costs very little for us to run that task, is it possible to force it to run, no matter what?
Maybe there's some kind of bug that fails to clear gradle cache. One possible solution would be to first force the task to clean its own output by running cleanProcessResources
.
If that does not work then try overriding the upToDateWhen
predicate of your task's outputs like this:
processResources.outputs.upToDateWhen{ false }
However I don't know if this API is permanent.
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