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 cumbersome environment setup and various spring configurations in ssm. In short , which is a very practical framework.
2 Getting Started
2.1 Import dependencies
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.9.RELEASE</version> </parent> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> </dependencies>
2.2 Write the main program class
/** * @SpringBootApplication来标注一个主程序类 * 说明这是一个Springboot应用 */ @SpringBootApplication public class HelloWorldMainApplication { public static void main(String[] args) { // 让Springboot运行起来 SpringApplication.run(HelloWorldMainApplication.class,args); } }
2.3 Write the controller layer
@Controller public class HelloController { @RequestMapping("/hello") @ResponseBody public String hello() { return "hello"; } }
2.4 Run the main program Program
After the main program is started, enter http://localhost:8080/hello
2.5 Deployment project
Add a jar package plug-in to pom.xml, and then package it in the maven lifecycle. Then there will be a jar file in the target directory, copy it to the folder, and then use java -java xxx in the command window. The jar is deployed successfully.
<!-- 这个插件,可以将应用打包成一个可执行的jar包;--> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build>
3 Use spring Initializr to quickly create Springboot
##
The above is the detailed content of Springboot project deployment method. For more information, please follow other related articles on the PHP Chinese website!

The article discusses using Maven and Gradle for Java project management, build automation, and dependency resolution, comparing their approaches and optimization strategies.

The article discusses creating and using custom Java libraries (JAR files) with proper versioning and dependency management, using tools like Maven and Gradle.

The article discusses implementing multi-level caching in Java using Caffeine and Guava Cache to enhance application performance. It covers setup, integration, and performance benefits, along with configuration and eviction policy management best pra

The article discusses using JPA for object-relational mapping with advanced features like caching and lazy loading. It covers setup, entity mapping, and best practices for optimizing performance while highlighting potential pitfalls.[159 characters]

Java's classloading involves loading, linking, and initializing classes using a hierarchical system with Bootstrap, Extension, and Application classloaders. The parent delegation model ensures core classes are loaded first, affecting custom class loa


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Linux new version
SublimeText3 Linux latest version

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.