Home > OS >  Questions about fileContentReplaceItemConfig search pattern using groovy
Questions about fileContentReplaceItemConfig search pattern using groovy

Time:12-11

I have the following groovy instructions applied on Jenkins.

stage('Replace content') {
  steps {
    contentReplace(
     configs: [
        fileContentReplaceConfig(
              configs: [
                 fileContentReplaceItemConfig(
                       search: ".appName.*",
                       replace: ''
                 )
              ],
         fileEncoding: 'UTF-8',
         filePath: 'register.scala')
     ])
  }
}

What is the meaning of the pattern ".appName.*"? Every line which contains the word 'appName', the entire line will be removed in register.scala file?

CodePudding user response:

Content Replace plugin

The regex

  • Related