spring boot 简单启动
1.在父工程中引用
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
然后在当前项目里面应用
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
然后写一个Application类,在类注解
@SpringBootApplication ,然后在main方法里面
SpringApplication.run(Application.class);
就可以直接运行main方法。浏览器localhost:8080就可以了。

浙公网安备 33010602011771号