DEV Community

caglarcercinlidev
caglarcercinlidev

Posted on

1 1

HOW TO CREATE A JAR FILE ON A SPRING/MAVEN PROJECT

A jar file is in fact a server-runnable code.
On terminal execute this command:
mvn package
This command will build the project, run the tests and create a jar file. So be sure that all tests are passing.

After that, check the target folder, jar file will be there.

Image description

Now it is time to run this jar file. Command:
java -jar <name>.jar
With this command, the application will be running on the specified localhost port (default 8080). You can test it.

Happy coding with no errors!

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more