Migrating Project from Gradle 3.4 to 5.4.1 because of Java11 change

Hi I am trying to migrate my project from gradle 3.5 version to 5.4.1
task abcfunction(dependsOn: classes, type: Jar) {
from sourceSets.main.output.classesDir

destinationDir = getRootProject().file('abcpath')

changed to
sourceSets.main.java.outputDir = new File(buildDir, “abcpath”)

dependencies {
compile files(sourceSets.elvis.output.classesDir)

Could not get unknown property ‘classesDir’ for elvis classes of type org.gradle.api.internal.tasks.DefaultSourceSetOutput.

I think you want sourceSets.elvis.output.classesDirs.

i think this is not solving issue …