Now let's do it with Maven !
First you use your jar, in Maven, you can to configure it this way:
Now you would like your jar to contain all the dependencies, then you use the maven-assembly-plugin. But it won't take the configuration set in the jar plugin. You have to reconfigure the exact same main-class again. It is redundant OK, but why should it have a different syntax !?!
OK, the point is that there are at least two way to configure the Manifest. Either with a free key/value syntax, with Manifest Entries. Or with the class Manifest which has a mainClass element. So it is up to you to be consistent in your POM and not copy everything found on the net ...
- Even if the assembly plugin doesn't explicitly mention it, both plugins depend on the Maven Archiver shared component.
- You could also specify your own manifest file META-INF/MANIFEST.MF.
- There is a Maven Guide to Working with Manifests with few information and no links to the relevant information which is a shae for a "Guide".