Jar manifest creation is happening too early. provide support for delaying production of manifest

I can understand that under some conditions the jar should be recreated when the manifest changes.

I would suggest that most people would not want jar to be recreated solely based on manifest change.

We have a project with about 300 sub projects and when we added an attribute using Jenkins BUILD_NUMBER env-var we discovered that all jars are recreated.

The problem seems to be that the jar task will produce a manifest based on what it knows before executing the task.

If you place manifest into jar.doFirst the empty manifest that is derived before execution is different from the one that was produced the previous time and results in the production of a new empty manifest.

I would suggest a change to jar/ear/war tasks that prodive an option called delayManifest which will only attempt to produce the manifest when the jar needs to be built because of other changes excluding the manifest.

The only time the manifest should be an input dependency for the jar task is when manifest.from … is used.