Search code examples
grailsgroovy

grails "unable to resolve class groovy.util.FileNameFinder"


I'm trying to modify a grails service that someone else (who is away on leave) set up, but I get this when I try to run grails war or grails run-app:

    ...unable to resolve class FileNameFinder 
     @ line 27, column 30.
    def labelFiles = new FileNameFinder().getFileNames(gazetteersFolder, "**/label.txt")

I get the same error on a different line if I add "import groovy.util.FileNameFinder" to the top of that class.

How is this possible? I thought groovy automatically provided (and imported) all of groovy.util.*?


Solution

  • Have you configured Groovy SDK properly?

    You can achieve same with following code:

    def labelFiles = new FileNameByRegexFinder().getFileNames(gazetteersFolder, "label.txt")
    

    Hope this will helps you.