Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of Springboot project deployment

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Today, the editor will share with you the relevant knowledge points about the method of Springboot project deployment. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.

1 introduction

Springboot is equivalent to a practical tool framework, it integrates the three major frameworks of ssm and simplifies the development steps, eliminating the tedious environment construction and various spring configurations in ssm. In a word, this is a very practical framework.

2 getting started

2.1 Import dependencies

Org.springframework.boot spring-boot-starter-parent 1.5.9.RELEASE org.springframework.boot spring-boot-starter-web

2.2 write the main program class

/ * * @ SpringBootApplication to mark a main program class * indicates that this is a Springboot application * / @ SpringBootApplicationpublic class HelloWorldMainApplication {public static void main (String [] args) {/ / Let Springboot run SpringApplication.run (HelloWorldMainApplication.class,args);}}

2.3Writing controller layer

@ Controllerpublic class HelloController {@ RequestMapping ("/ hello") @ ResponseBody public String hello () {return "hello";}}

2.4 run the main program

Enter http://localhost:8080/hello in the browser after the main program starts

2.5 deployment project

Add a plug-in to the jar package in pom.xml, then package it with package in maven's lifecycle, then there will be a jar file in the target directory, copy it to a folder, and then use java-java xxx.jar in the command window to deploy successfully.

Org.springframework.boot spring-boot-maven-plugin 3 uses spring Initializr to quickly create Springboot

These are all the contents of the article "how to deploy the Springboot Project". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report