I have a project that contains a single module, and some dependencies. I\'d like to create a jar, in a separate directory, that contains the compiled module. In addition, I\
Here are 2 examples with maven project, step by step:
at pom.xml, add maven-jar-plugin.
org.apache.maven.plugins
maven-jar-plugin
3.1.0
true
lib/
somePackage.sample
screen capture: 4. open maven project box by click on the search icon and type maven,
click on clean, then click on install
your jar file will show up inside the target folder
test your jar using java -jar
The MANIFEST.MF needs to be in your resources folder and the Main.Class needs to refer to {package}-{class-name-that-contains-main-class}