SpringBoot学习(一)
SpringBoot简单的实现增删改查服务
1、pom需要的架包
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!--mybatis-->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.0.0</version>
</dependency>
<!-- mysql -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
2、配置TestController,interface,Application,UserMapper.xml文件配置,application.properties
Application
3、选择Application,运行Run/Debug As,
4、打包Run/Debug As --->Maven install,默认打成jar,pom.xml文件配置<packaging>jar</packaging>
5、java架包启动可以修改端口号
java -jar spring-boot-***.jar --server.port=9999
后台启动nohup java -jar spring-boot-***.jar --server.port=9999 & tail -f nohup.out
6、postman 访问IP:9999/hello
以上是 SpringBoot学习(一) 的全部内容, 来源链接: utcz.com/z/517251.html