plugins {
// Apply the java plugin to add support for Java
id 'java'
id 'maven'
// Apply the application plugin to add support for building a CLI application.
id 'application'
// spring boot gradle 插件
id 'org.springframework.boot' version '2.2.7.RELEASE'
// spring boot gradle 依赖插件
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
}
group 'com.cpicdg'
version '1.0-SNAPSHOT'
sourceCompatibility = JavaVersion.VERSION_14
targetCompatibility = JavaVersion.VERSION_14
//依赖管理
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:Greenwich.SR5"
mavenBom "com.alibaba.cloud:spring-cloud-alibaba-dependencies:2.2.0.RELEASE"
}
}
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
maven{ url 'https://maven.aliyun.com/nexus/content/groups/public'}
maven{ url 'https://maven.aliyun.com/nexus/content/repositories/jcenter'}
maven{ url 'https://repo1.maven.org/maven2/'}
}
dependencies {
//------spring boot
//整合web
compile 'org.springframework.boot:spring-boot-starter-web'
//整合 aop
compile 'org.springframework.boot:spring-boot-starter-aop'
//整合 actuator
compile 'org.springframework.boot:spring-boot-starter-actuator'
//整合 jdbc
compile 'org.springframework.boot:spring-boot-starter-jdbc'
//spring cloud
// 整合 feign
compile 'org.springframework.cloud:spring-cloud-starter-openfeign:2.2.3.RELEASE'
//--------spring cloud alibaba 依赖
// nacos 服务中心依赖
compile 'com.alibaba.cloud:spring-cloud-starter-alibaba-nacos-discovery'
//整合 sentinel
compile 'com.alibaba.cloud:spring-cloud-starter-alibaba-sentinel'
//---整合数据库 使用mybatis/beetlsql
//mysql 驱动
compile 'mysql:mysql-connector-java:6.0.6'
//beetlsql
compile 'com.ibeetl:beetl-framework-starter:1.2.31.RELEASE'
compile 'com.ibeetl:beetlsql:2.12.29.RELEASE'
//JWT token 工具依赖
compile 'io.jsonwebtoken:jjwt-api:0.11.1'
runtime 'io.jsonwebtoken:jjwt-impl:0.11.1'
runtime 'io.jsonwebtoken:jjwt-jackson:0.11.1'
//fastjson
compile 'com.alibaba:fastjson:1.2.68'
//spring boot test
testCompile('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
//junit 5
testCompile 'org.junit.jupiter:junit-jupiter:5.5.2'
//lombok
implementation 'org.projectlombok:lombok:1.18.8'
annotationProcessor 'org.projectlombok:lombok:1.18.8'
testCompileOnly 'org.projectlombok:lombok:1.18.8'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.8'
}
tasks.withType(JavaCompile) {
options.compilerArgs += "--enable-preview"
}
tasks.withType(Test) {
jvmArgs += "--enable-preview"
}
tasks.withType(JavaExec) {
jvmArgs += "--enable-preview"
}
Spring Cloud alibaba gradle 配置参考
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...