提问人:Rahul Sheth 提问时间:11/13/2023 更新时间:11/13/2023 访问量:20
Gradle 从 JDK 8 迁移到 17 [已关闭]
Gradle Migration from JDK 8 to 17 [closed]
问:
使用 gradle 包装器更新 Gradle 配置
- gradle 属性的 gradle 3.5 [JDK 8] 迁移到 7.4.2 [Jdk 17]
- 适用于 gradle 7.4.2 的 Gradle Wrapper Jar 更新
- build.gradle update w.r.t 更改
答:
-1赞
Rahul Sheth
11/13/2023
#1
1. gradle-wrapper.properties
- change the distribution url from 3.5 to
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
2. Download and update gradle wrapper jar of 7.4.2
3. build.gradle
- For all maven definition in repositories. add the following in BOLD
maven {
url "https://engci-maven-master.cisco.com/artifactory/cable-smartphy-maven"
**metadataSources {
mavenPom()
artifact()
}**
}
- ivy report updates
> layout 'pattern', {..} -> layout "maven", patternLayout {..}
- Change all the dependencies
> compile -> implementation
> testCompile -> testImplementation
> destinationDir -> destinationDirectory
> baseName -> archiveBaseName
> extension -> archiveExtension
- Updates the following for jacocoTestReport
> classDirectories = files(classDirectories.files.collect {..} ->
classDirectories.setFrom(files(classDirectories.files.collect {..}
> xml.enabled false -> xml.required false
csv.enabled false -> csv.required false
html.destination "${buildDir}/reports/coverage" -> html.outputLocation "${buildDir}/reports/coverage"
- Main command to build updates
> build.dependsOn test, jacocoTestReport, dist -> build { dependsOn test, jacocoTestReport, dist }
- Delete the task wrapper for defining gradle wrapper
task wrapper(type: Wrapper) {
gradleVersion = '3.5'
}
评论