springboot学习笔记-01
1、创建一个maven web项目
选择quickstart,保存。目录结构如下
修改pom.xml文件
添加
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
</parent>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
修改App.java
@SpringBootApplication
public class App {
public static void main( String[] args ) {
SpringApplication.run(App.class, args);
}
}
保存,运行。
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.5.9.RELEASE)
2018-10-31 20:46:58.021 INFO 5440 --- [ main] springboot.springboot_01.App : Starting App on sky-PC with PID 5440 (E:\sasuke_code\springboot-01\target\classes started by sky in E:\sasuke_code\springboot-01)
2018-10-31 20:46:58.023 INFO 5440 --- [ main] springboot.springboot_01.App : No active profile set, falling back to default profiles: default
2018-10-31 20:46:58.085 INFO 5440 --- [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@7857fe2: startup date [Wed Oct 31 20:46:58 CST 2018]; root of context hierarchy
到时,最简单的springboot项目就创建好了。