I try to generate a .zip file with maven (mvn package) and want to have a MANIFEST file in the zip too. The jar file itself does work.
I tried to generate a MANIFEST file with maven jar plugin, but it did not work.
Do I Have to do something else to get a MANIFEST file, or is it enough to use this plugin? The parent pom (parent of the parent I showed) has maven assembly plugin. (I´m completely new to maven)
pom.xml file of the parent pom:
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
</pluginManagement>
</build>
pom.xml file of the module:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<manifest>
<mainClass>org.jis.Main</mainClass>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
Best Answer
In your case maven must be called like:
The other way to achive same result is to modify your pom:
then run:
ref: https://maven.apache.org/plugins/maven-assembly-plugin/usage.html