I'm using groovy in my Jenkinsfiles. The gradle-build creates a jar looking like this: appName-1.0.0-ua67435.jar
and is copied to /opt/appName
In the Jenkinsfile (Groovy) I now like to get this part of the string 1.0.0-ua67435
in a variable. I hope this regex should do the job: -(.*?).jar$
I know where my file is, but I don't know its name. Its the only .jar
in the /opt/appName/
-folder.
How can I get the substring of my filename when I only know its place and name-pattern?