【发布时间】:2018-02-05 21:24:33
【问题描述】:
我在 linux-version: "4.4.0-43-generic" 上使用 maven verison 3.3.9。不知何故,我可以在控制台上使用这种方式运行 maven 命令:
mvn -pl '!com.mycom.hp.comp:zonegtools,!com.mycom.hpe:testbed' -P compileWithGradle,nightly,flex-debug clear
单引号内的双引号我不知道原因,但它在控制台上以这种方式工作。我有一个 jenkins 管道,我想在其中使用这个命令,但我使用的它不起作用:
sh ''' mvn -pl '"!com.mycom.hp.comp:zonegtools,!com.mycom.hpe:testbed"' -P compileWithGradle,nightly,flex-debug clear '''
或者使用:
sh """ mvn -pl '"!com.mycom.hp.comp:zonegtools,!com.mycom.hpe:testbed"' -P compileWithGradle,nightly,flex-debug clear """
结果将在"!com.mycom.hp.comp:zonegtools,!com.mycom.hpe:testbed" OR '!com.mycom.hp.comp:zonegtools,!com.mycom.hpe:testbed' 中给出
谁能告诉我在 jenkins 脚本或 maven 目标中使用的正确方法。
【问题讨论】:
标签: shell maven jenkins groovy jenkins-pipeline