I created a spring boot project which uses gradle. The project has a settings.gradle file, and i used groovy class in this file but can not be imported. The code is used to include sub modules.
import groovy.io.FileType // can not be imported
import java.nio.file.Paths
rootProject.name = 'godlenfire'
String rootPath = rootProject.projectDir.path
['app'].forEach {
File dir = Paths.get(rootPath, it).toFile()
dir.traverse([maxDepth: 3, nameFilter: 'build.gradle', type: FileType.FILES]) {
def module = relativePath(it.parent).replace File.separator, Project.PATH_SEPARATOR
include module
logger.lifecycle("include ${module}")
}
}
Thanks.

I excepted to import groovy class in .gradle file successfully.
Here is the gradle-wrapper.properties


