Monday, July 16, 2012

MANIFEST.MF is not refreshed during jar generation

I created a new maven module, then I added some java source code. I also modified MANIFEST.MF file also. But while performing Run As -> Maven Project, the generated jar doesn't contains the modified MANIFEST.MF file.

The reason being is "MANIFEST.MF" should end with  a empty line. That means, after all adding any content, just click enter and save the file.

It worked for me.

In other words:

The last line in the manifest must end with a newline character. Otherwise, the manifest will not be read correctly. It is a common error to produce a text file containing just the Main-Class line without a line terminator.