I want to use Maven to generate the JAR with its dependencies in .jar
format, the solutions I found are not valid.
Eclipse has three ways to generate an executable JAR.
And does Maven have a form equivalent to Eclipse?
Using maven-jar-plugin
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<mainClass>qualquer.que.seja.seu.pacote.ClasseMain</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
Problem: This mode generates a JAR with no dependencies in .jar
format.
Using maven-assemply-plugin
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>qualquer.que.seja.seu.pacote.ClasseMain</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
Problem: Generates a JAR with the "extracted" dependencies out of the .jars
format.