I\'m trying to package a project using OptaPlanner 6.0.1 libraries into a .jar through IntelliJ IDEA\'s jar artifact but instead of my manifest.mf containing the standard
As noted in @grudolf's comment in one of the other answers, one way to do this (and the only one that worked for me in an imported Gradle project) is to create an empty jar as follows:
This is definitely a bug in Idea. This linked answer works reliably when there are extracted directories. In essence, you find your .idea/JARNAME.xml, add add the following element to the very top of the <root>
element for your jar. Any extracted elements above your new file-copy that contain a manifest will clobber your new manifest.
<element id="directory" name="/META-INF">
<element id="file-copy" path="$PROJECT_DIR$/modulename/src/META-INF/MANIFEST.MF" />
</element>