How to run your Spring Boot JAR file from the command line

How to run your Spring Boot JAR file from the command line

Cameron McKenzie

1 год назад

4,228 Просмотров

When you build a RESTful web service with Spring Boot, your app is deployed to an embedded Tomcat server that is packaged inside a JAR file.

When you ask Maven or Gradle to do a build of your Spring Boot 3 app, this executable JAR file is automatically created for you.

To run the executable Spring Boot JAR file at the command line, all you have to do is dig inside the Gradle build folder or the Maven target folder, locate the JAR and then run:

java -jar spring-boot-3-app.jar

This will kick off the Spring Boot app, open port 8080 if the defaults are used, and allow you to bring your application up on localhost.

It's just that easy to run a Spring Boot JAR file at the command line. And once you do that, dockerizing Spring Boot is a lead pipe cinch!

Тэги:

#cameronmcnz #theserverside #java #jakarta #jakartaee #git #github #gitlab #dvcs #versioncontrol #tortoisegit #gitgui #atlassian #bitbucket #linux #azure #devops #devopstools #gitops #gitopstools #azuredevops #springboot #springsource #spring #vmware #cloudnative #tomcat #apache #JAR #softwaredeveloper #computerprogramming #programming #softwareengineer
Ссылки и html тэги не поддерживаются


Комментарии: