How to create executable jar using maven

Sometimes we need to create executable jar file from a standalone application using maven because you want to put the executable jar file anywhere and just want to run the file to do some operations from command line.



Apache Maven

We need maven compiler plugin to compile the java files

We need maven jar plugin to create a jar file from the application

Putting all together, the entire pom.xml file is given below

That’s all. Thanks for reading.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.