# SpringBootBasic **Repository Path**: HenryGuo/SpringBootBasic ## Basic Information - **Project Name**: SpringBootBasic - **Description**: 基础的Spring Boot 用法 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2017-12-20 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README **学习笔记** 1、创建Spring Boot项目: 通过Idea ,New Module,选择Spring initializr 通过https://start.spring.io/ 2、实现RESTful API接口: 见代码。 3、Spring Boot启动 生成文件的main方法启动:SpringApplication.run maven commond:spring-boot:run ,或者直接运行mvn spring-boot:run Idea中Maven 插件中Plugin执行spring-boot:run 服务器运行:mvn install打包成jar,在java -jar 4、单元测试 MockMvc mvc = MockMvcBuilders.standaloneSetup(CLAZZ).build(); mvc.perform(MockMvcRequestBuilders.get("/hello").accept(MediaType.APPLICATIOB_JSON)) .andExpect(status().isOK()) .andExpect(content().string(equalTo("hello World"))); 4、Spring Boot监控和管理 依赖模块:actuator org.springframework.boot spring-boot-starter-actuator 5、项目远程提交(git) 1.在Github上建立仓库 2.在本地配置远程仓库 cd本地仓库目录 git remoteadd origin 你项目的地址 https://gitee.com/HenryGuo/SpringBootBasic git remote add origin https://github.com/hanhailong/CustomRatingBar git push-u origin master Git pull origin master