The following piece of code works fine in Groovy, but Jenkins complains about unexpected token: ->
final def files = findFiles(glob: filePattern)
final def rootNode = files.stream()
.map(file -> findByContent(file.getPath()))
.filter(node -> node != null)
.findFirst()
To get this working in a local Groovy script the findFile is switched with a simple List of strings.
So why is it not working in Jenkins?