您的脚本需要更加缩进: - bash: | if [ -f Maven pom.xml ]; then echo "##vso[task.setVariable variable=FILEEXISTS]true" fi - task: Maven@3 etc
- bash: | if [ -f Maven pom.xml ]; then echo "##vso[task.setVariable variable=FILEEXISTS]true" fi - task: Maven@3 etc