In jenkins Job, I am taking a String parameter as below:
FoldersList = test1,test2,test3,Folder name1,Folder name2,Folder name3
when I pass this value to environment variable the jenkins job fails with error : Unknown lifecycle phase etc etc since spaces are not allowed in folder names.
I am passing the environment variable like this in goals and options section :
exec:java -Dexec.classpathScope="test" -Dexec.mainClass="com.mypackage.main.TestNGRunner" -Dexec.cleanupDaemonThreads=false "-Dexec.args=-inputexcel=Data.xlsx -jenkinsJobName=testJob -layer=MultiplefolderTest -InpFoldersList="\"$inpFoldersList"\" -threadCount=12 -retryCount=3"
If I pass a single string within double quotes it works but the user will enter multiple folder names possibly with spaces. Please can somebody help since I tried different options but none work. Is there a way to manipulate the string and pass it to the environment variable.