【IT专家】使用idea搭建springboot+gradle+mysql项目

发布时间:2019-05-06   来源:文档文库   
字号:
本文由我司收集整编,推荐下载,如有疑问,请与我司联系
使用 idea 搭建 springboot+gradle+mysql 项目
2017/03/28 5928

2.build.gradle 配置文件
group ‘com.great’version ‘1.0-SNAPSHOT’buildscript { ext { springBootVersion = ‘1.2.2.RELEASE’
}
repositories
{
mavenCentral(
}
dependencies
{ 1.新建一个新的 gradle 项目
classpath(“org.springframework.boot:spring-boot-gradle- plugin:${springBootVersion}” }}apply plugin: ‘java’apply plugin: ‘eclipse’apply plugin: ‘idea’apply plugin: ‘spring-boot’jar { baseName = ‘ng-spring-boot’ version = ‘0.0.1- SNAPSHOT’}sourceCompatibility = 1.7targetCompatibility = 1.7repositories { mavenCentral( maven { url “https://repo.spring.io/libs-release” }}dependencies { compile(“org.springframework.boot:spring-boot-starter-data-jpa” compile(“org.springframework.boot:spring-boot-starter-web”
compile(“org.springframework.boot:spring-boot-starter-actuator” runtime(“mysql:mysql- connector-java”
testCompile(“org.springframework.boot:spring-boot-starter-test”}task
wrapper(type: Wrapper { gradleVersion = ‘2.3’} 3.创建实体类
package
com.great.dept.domain;import org.hibernate.annotations.GenericGenerator;import javax.persistence.*;/** * 部门表实体 */@Entity@Table(name = “dept”public class Dept { //部门编号 主键 @Id @Column(name = “id”
@GeneratedValue(generator
= “uuid2”
@GenericGenerator(name = “uuid2”, strategy = “uuid2” private String id; //部门编码 @Column(name = “code” private String code; //部门名称 @Column(name = “name” private String name; public String getId( { return id; } public void setId(String id { this.id = id; } public String getCode( { return code; } public void setCode(String code { this.code = code; } public String getName( { return name; } public void setName(String

本文来源:https://www.2haoxitong.net/k/doc/819c82ba3069a45177232f60ddccda38366be104.html

《【IT专家】使用idea搭建springboot+gradle+mysql项目.doc》
将本文的Word文档下载到电脑,方便收藏和打印
推荐度:
点击下载文档

文档为doc格式