IntelliJ IDEA 2016.1 Help

Create Jar from Modules Dialog

File | Project Structure | Artifacts - add - Jar - From modules with dependencies

ModuleFrom the drop-down list, select the module to be used for the artifact. Note that the specified module will be packaged into an artifact together with all the other modules it depends on.
Main classSpecify the class with the main method.

This class name becomes a value of the Main-Class attribute in the MANIFEST.MF file, generated by IntelliJ IDEA.

Jar files from librariesSpecify the way how the jar files from libraries will be treated:
  • Extract to the target jar. If this option is selected, then IntelliJ IDEA will produce a single jar archive, to which all the modules outputs and the contents of the directories will be packaged.
  • Copy to the target directory and link via manifest. If this option is selected, IntelliJ IDEA will produce a jar archive with the modules outputs, and separate jars from the libraries. The main jar file will include MANIFEST.MF file, with the libraries jars specified in the Classpath field of the manifest.

Note that the libraries here include all the dependencies of the module in question, including the transitive dependencies (the libraries from the dependencies of the modules the current one depends on.)

Directory for META-INF/MANIFEST.MFIf IntelliJ IDEA generates MANIFEST.MF file, in this field you have to specify where this file will be stored.
Include testsIf this check box is selected, the compiled classes from the tests roots of a module (and its dependencies) will be packaged into an artifact.

See Also


Last modified: 13 July 2016