How do I add my own manifest file to a jar file?
Author: Deron Eriksson
Description: This tutorial describes how to add a custom manifest file to a jar file.
Tutorial created using: Windows Vista || JDK 1.6.0_04 || Eclipse Web Tools Platform 2.0.1 (Eclipse 3.3.1)

Page:    1 2 >

In another tutorial, we saw how the contents of the src/main/resources folder in a mavenSW project with "jar" packaging get copied to the root level of the generated jarW file. We saw how we could put a META-INF directory in the resources directory, and files placed within META-INF could get copied into the META-INF directory of the jar file. What happens if we put a MANIFEST.MF file within src/main/resources/META-INF/MANIFEST.MF? Perhaps surprising, this file will NOT by default get copied into the generated jar file.

If we'd like the values in our MANIFEST.MF file to get copied over, we need to add a reference to this file in our pom.xml file, as shown here.


<project xmlns="" xmlns:xsi=""

I created the following MANIFEST.MF file.


Bacon: Eggs
Here: There

(Continued on page 2)

Page:    1 2 >