Automatically exported from code.google.com/p/onejar-maven-plugin
Technique A - In addition to a 'regular' executable jar file
Just drop the following code into your pom.xml and run mvn package
Caveat
I wanted to get the latest version of this plugin out, and as a result I haven't spend the time to remove the warning from OneJar about a missing main/main.jar when this technique is used. I will be fixing this in the future, just not right now.
It (apparently) does not effect exectution and is just a warning.
The full text of the error is:
Boot: Warning: Unable to locate main/main.jar in the JAR file target/myproject-1.0-SNAPSHOT.one-jar.jar Technique B - Instead of a 'regular' executable jar file
Just drop the following code into your pom.xml and run mvn package