I am attempting to write a pipeline script to use with Jenkins 2.0 to replicate our existing build. This original build used the envInject plugin to read a Java properties
Use:
def props = readProperties file: 'config/general.properties'
In case your properties file located in Groovy Library, and source code located in different place, you should use the Resources folder from the Groovy Library.
Hence add below line:
--> def propFileContent = libraryResource 'config/general.properties'
def props = readProperties text: propFileContent
Notes:
"config" is some folder inside 'resources' folder
pay attention, in first places used word "file:", in second used "text:"