Setting properties in MANIFEST.MF or JAR Artifact

When I use the JAR (or Other) Artifact Build configuration, the /src/main/java/META-INF/MANIFEST.MF file is overwritten, destroying my hand-crafted version.

This would be okay if I could ensure that I could inject the properties I want. I cannot figure out how to inject "Specificaton-Title" or "Implementation-Vendor" or any of the standard manifest properties.

Any help is appreciated.

4 comments
Comment actions Permalink

Hello.

1. Looks like the known issue: https://youtrack.jetbrains.com/issue/IDEA-114077

2. Independently of this: do you use Maven? In IDEA 14 manifest entries should be taken from <manifestEntries> element in pom.xml, at least for maven war plugin. Please see https://youtrack.jetbrains.com/issue/IDEA-82725 for details.

3. Yet another topic: maybe you already use some Maven configuration for manifest entries or so? So, you can share a snippet from pom.xml that you need to work (IF you use pom.xml, of course).

Regards,
Alexander.

0
Comment actions Permalink

Thanks @Alexander, I am not building my manifest via Maven - as I mentioned in my OP it's a hand-crafted manifest at this point, and I'm trying to find a path forward where it can be automated. I'm looking into the Maven functionality right now. Thanks for the pointer.

0
Comment actions Permalink

I successfully package a jar with a correct manifest.mf file using maven.

IntelliJ IDEA is still completely borked, even though claims to have it fixed in version 138.473, but I'm running 139.1117.

If I accept the generated MANIFEST.MF file (created during Artifact creation process, and overwriting my custom MANIFEST.MF), then it is placed in the jar. If I turn around and re-overwrite the generated file with my custom file, the jar does not include the MANIFEST.MF.

Both IntelliJ IDEA and Maven generated JARs should be identical, given the proper configurations. At the moment, this seems impossible.

0
Comment actions Permalink

Figured it out... turns out IntelliJ IDEA needs the "Manifest-Version: 1.0" attribute. If it's missing, then the file is ignored by IntelliJ.

1

Please sign in to leave a comment.