Besides that, every project generates a runnable jar (one that can be executed by typing java -jar name_of_the_jar.jar). This is achieved by using the maven-jar-plugin which creates a jar with a MANIFEST.MF
file with the correct values. The most important attribute for that file is Main-Class
, which sets the entry point for the program. In addition, all the dependencies are set as entries in the Class-Path
attribute for that file. In order to execute it on another computer, you just need to copy the main jar file and the lib directory (with all the jars included there) which are located under the target directory.