Are you saying that the manifest content changes but you nevertheless want the ‘war’ task to be up-to-date? The straightforward solution would be to prevent the manifest content from changing during that time.
the content of the manifest file is supposed to change every build because it’s implementation version is generated based on a date pattern: manifest {
So, I am not building a single application, but a multiproject build (many Jar, War and Ear projects). The “full build” is triggered (and a version number is generated) when a developer commits a change into the source control. Our approach is to build only the components / projects that changed in order to reduce the deploy time. The problem is that the war task is never UP-TO-DATE if I use the following: manifest {
attributes(“Implementation-Title”: “Gradle”, “Implementation-Version”: “$bdImplementationVersion”) } Looking at the Gradle logs, I have noticed that it generates a temporary file to represent the manifest file.
I think generating a temp file means that the task is not UP-TO-DATE. Is there another way to achieve my goals? Thanks , Jefferson
It’s correct for Gradle to rerun the War task whenever the content of the manifest changes - after all, I assume we are talking about a manifest that will go into the War. (I don’t understand why you think that the temp file plays into this.) If you need a different behavior, you have to implement it yourself via ‘onlyIf {}’ (like you already did). I don’t know of an easy way to keep Gradle’s behavior except disregarding manifest changes.