Gradle Migration from JDK 8 to 17 [closed]

Gradle configuration updates using gradle wrapper

  • migration for gradle 3.5 [JDK 8] to 7.4.2 [Jdk 17] for gradle properties
  • Gradle Wrapper Jar update for gradle 7.4.2
  • build.gradle update w.r.t changes

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'
     } 
 

Leave a Comment