Spring Boot 的笔记

Spring Boot充分利用了JavaConfig的配置模式以及“约定优于配置”的理念,能够极大的简化基于Spring MVC的Web应用和REST服务开发。引用

Spring Boot 的笔记_第1张图片
Spring Start

使用 Gradle 构建

  • 使用 Gradle 新建项目时将 Use auto-import 勾上,当修改 build.gradle 时,Gradle 将自动进行构建;

  • Create directories for empty content roots automatically 将创建一个空的项目目录结构;
    建议将这个两个勾上(新手友好)

    Spring Boot 的笔记_第2张图片
    Spring Boot

  • 使用阿里云的 Maven 镜像可以加快下载速度:
    maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }

使用 Data-JPA 连接 MySQL

  • spring-boot-starter-data-jpaapplication.properties 配置:

     spring.datasource.url=jdbc:mysql://localhost/test
     spring.datasource.username=dbuser
     spring.datasource.password=dbpass
     spring.datasource.driver-class-name=com.mysql.jdbc.Driver
    
  • MySQL 连接教程:
    https://github.com/netgloo/spring-boot-samples/tree/master/spring-boot-mysql-springdatajpa-hibernate

学习资料
spring-boot-sample-simple
Building a RESTful Web Service
深入学习微框架:Spring Boot
使用 Spring Boot 快速构建 Spring 框架应用
SpringBoot-Learning
Spring Boot 学习

未完待续...

你可能感兴趣的:(Spring Boot 的笔记)