[GRADLE-1227] OSGI updates MANIFEST.MF even if no change Created: 17/Nov/10  Updated: 04/Jan/13  Resolved: 24/Apr/12

Status: Resolved
Project: Gradle
Affects Version/s: 0.9
Fix Version/s: 1.1-rc-1

Type: Bug
Reporter: Robert Fischer Assignee: Unassigned
Resolution: Duplicate Votes: 2

Issue Links:
Duplicate
Duplicates GRADLE-1545 up-to-date check for Jar task does no... Resolved

 Description   

The OSGI plugin updates the MANIFEST.MF with a new Bnd-LastModified even if there is no other change, resulting in the jar task always executing. This triggers downstream tasks to always execute, as well.

plenary-indulgence:ashlar robert$ gradle :ashlar-lang:jar ; md5 ./lang/build/tmp/jar/MANIFEST.MF ; cat ./lang/build/tmp/jar/MANIFEST.MF ; gradle :ashlar-lang:jar ; md5 ./lang/build/tmp/jar/MANIFEST.MF ; cat ./lang/build/tmp/jar/MANIFEST.MF
:ashlar-lang:compileJava UP-TO-DATE
:ashlar-lang:compileGroovy UP-TO-DATE
:ashlar-lang:processResources UP-TO-DATE
:ashlar-lang:classes UP-TO-DATE
:ashlar-lang:jar

BUILD SUCCESSFUL

Total time: 10.784 secs
MD5 (./lang/build/tmp/jar/MANIFEST.MF) = 5fc9f33d69fd054eb3af479b3b8004f7
Manifest-Version: 1.0
Private-Package: ashlar.lang
Bundle-Version: 0.0.1.SNAPSHOT
Tool: Bnd-0.0.384
Bundle-Name: ashlar-lang
Bnd-LastModified: 1290032094430
Created-By: 1.6.0_22 (Apple Inc.)
Bundle-ManifestVersion: 2
Bundle-SymbolicName: lang.ashlar.lang

:ashlar-lang:compileJava UP-TO-DATE
:ashlar-lang:compileGroovy UP-TO-DATE
:ashlar-lang:processResources UP-TO-DATE
:ashlar-lang:classes UP-TO-DATE
:ashlar-lang:jar

BUILD SUCCESSFUL

Total time: 11.073 secs
MD5 (./lang/build/tmp/jar/MANIFEST.MF) = a10e50371d7976ddb73daf6404f76ced
Manifest-Version: 1.0
Private-Package: ashlar.lang
Bundle-Version: 0.0.1.SNAPSHOT
Tool: Bnd-0.0.384
Bundle-Name: ashlar-lang
Bnd-LastModified: 1290032105715
Created-By: 1.6.0_22 (Apple Inc.)
Bundle-ManifestVersion: 2
Bundle-SymbolicName: lang.ashlar.lang



 Comments   
Comment by Roman Timushev [ 18/Apr/11 ]

Workaround is

jar {
    manifest {
        instruction '-removeheaders', 'Bnd-LastModified'
    }
}
Generated at Wed Jun 30 11:50:13 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.