Spring-boot开发环境搭建

下载Eclipse

http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/neonr

安装Java 1.8

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

安装Git、SourceTree(版本管理工具)

自行google

安装Gradle插件

从eclipse插件市场搜索gradle安装。


Spring-boot开发环境搭建_第1张图片
Gradle 插件

配置Gradle依赖

build.gradle

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:1.3.2.RELEASE") }
}

apply plugin: 'java'
apply plugin: 'spring-boot'
apply plugin: 'eclipse'

jar {
    baseName = 'help-center'
    version = '0.1.0'
    manifest { attributes 'Main-Class': 'cn.com.duiba.help.Application' }
}

repositories {
    mavenCentral()
}

dependencies {
    compile("org.springframework.boot:spring-boot-starter-web")
    compile("org.springframework.boot:spring-boot-starter-data-jpa") //jpa框架
    compile("org.springframework.boot:spring-boot-starter-velocity") //velocity 模板引擎
    compile("org.springframework.boot:spring-boot-starter-test") //单元测试
    compile("org.springframework:spring-tx") //Spring事务处理包
    compile('mysql:mysql-connector-java:5.1.34') //Mysql官方驱动包
    compile('commons-lang:commons-lang:2.6') //commons基础包,针对Java.lang包进行一些封装,提供一些工具类
    compile fileTree(dir: 'lib', include: '*.jar')
    testCompile("junit:junit")
}

编辑完后右键项目,刷新依赖

Spring-boot开发环境搭建_第2张图片
刷新依赖.png

项目结构

项目结构如下


Spring-boot开发环境搭建_第3张图片
项目结构图

你可能感兴趣的:(Spring-boot开发环境搭建)