buildscript {
ext {
springBootVersion = '1.5.9.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
allprojects {
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
group = 'com.springcloud'
version = '0.0.1-SNAPSHOT'
// JVM 版本號要求
sourceCompatibility = 1.8
targetCompatibility = 1.8
ext {
springBootVersion = '1.5.9.RELEASE'
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
compile('org.springframework.boot:spring-boot-starter')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
// 顯示當前項目下所有用于 compile 的 jar.
task listJars(description: 'Display all compile jars.') << {
configurations.compile.each { File file -> println file.name }
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
// java編譯的時候缺省狀態下會因為中文字符而失敗
// [compileJava,compileTestJava,javadoc]*.options*.encoding = 'UTF-8'
//定義版本號
ext {
springCloudVersion = 'Dalston.SR1'
}
/*configurations {
// 所有需要忽略的包定義在此
all*.exclude group: 'commons-httpclient'
all*.exclude group: 'commons-logging'
all*.exclude group: 'commons-beanutils', module: 'commons-beanutils'
}*/
dependencies {
// 通用依賴
/* compile(
"org.springframework:spring-context:$springVersion"
)*/
// 依賴maven中不存在的jar
// ext.jarTree = fileTree(dir: 'libs', include: '**/*.jar')
// ext.rootProjectLibs = new File(rootProject.rootDir, 'libs').getAbsolutePath()
// ext.jarTree += fileTree(dir: rootProjectLibs, include: '**/*.jar')
//
// compile jarTree
// 測試依賴
testCompile('org.springframework.boot:spring-boot-starter-test')
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
}
2018-01-09 構建多項目 父組件配置文件 build.gradle
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。
推薦閱讀更多精彩內容
- 上一節 : 多模塊項目- settings文件 在根項目下,除了 settings.gradle 文件之外,通常還...
- 在我們使用vue-cli創建生產的項目build后,默認會生成大量的.map文件,如下圖: 這些.map非常大,所...