I'm using the minijar-maven-plugin to reduce the size of my jar-with-dependencies jar but I need to specify a mainClass like I can do easily with the maven assembly plugin. How can i specify the mainClass in the manifest while still using the minijar plugin?
My minijar configuration is the default:
<plugin>
<artifactId>minijar-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>ueberjar</goal>
</goals>
<configuration>
<includeArtifact>true</includeArtifact>
<stripUnusedClasses>false</stripUnusedClasses>
<includeDependencies>
<param>org.vafer:dependency</param>
</includeDependencies>
<includeDependenciesInRelocation>
<param>org.vafer:dependency</param>
</includeDependenciesInRelocation>
</configuration>
</execution>
</executions>
</plugin>
I can specify the main class in a maven assembly plugin using:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.chheng.Main</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>