plugins {
id 'java'
id 'eclipse'
id 'idea'
# 统一springboot版本号
id 'org.springframework.boot' version '2.1.1.RELEASE' apply false
# 依赖io.spring.dependency-management 插件后可以同意管理版本号
id 'io.spring.dependency-management' version '1.0.6.RELEASE' apply false
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
jar {
enabled = true
}
bootJar {
classifier = 'boot'
}
ext {
#配置springcloud版本号
set('springCloudVersion', 'Greenwich.SR2')
}
# 使用 dependencyManagement 配置统一springcloud版本号
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
group = 'com.hahaha'
version = '0.1.0'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
}
dependencies {
implementation('org.springframework.cloud:spring-cloud-starter-netflix-eureka-client')
implementation('org.springframework.boot:spring-boot-starter-web')
}
原文:https://www.cnblogs.com/CHWLearningNotes/p/11153025.html