-
Notifications
You must be signed in to change notification settings - Fork 48
Manifest expression injection
Andrey Hihlovskiy edited this page Apr 25, 2014
·
24 revisions
We already programmed manifest attributes in MANIFEST.MF. Now we will learn how to do manifest expression injection.
- The easiest way to do manifest expression injection is to use gradle/groovy capabilities. Add new instruction to jar/manifest in "build.gradle":
instruction 'Project-Info', "${project.name} compiled on ${new Date()}"- Invoke on command line:
gradle build
- Open file "tutorials/MyOsgiPlugin/build/libs/MyOsgiPlugin-1.0.0.0.jar", open "META-INF/MANIFEST.MF", it should contain:
Project-Info: MyOsgiPlugin compiled on Fri Apr 25 12:46:22 CEST 2014
- We can also program expression injection in "META-INF/MANIFEST.MF". Edit the file "tutorials/MyOsgiPlugin/src/main/resources/META-INF/MANIFEST.MF",