且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用groovy脚本在Jenkins管道作业中调用Ant?

更新时间:2023-12-05 15:13:40

您像使用maven一样调用ant(请参阅示例 https://jenkins.io/doc/pipeline/jenkinsfile/ ):

You invoke ant just like you do it with maven (take a look at examples https://jenkins.io/doc/pipeline/jenkinsfile/):

 node ('linux'){
  stage 'Build and Test'
  env.PATH = "${tool 'Ant'}/bin:${env.PATH}"
  checkout scm
  sh 'ant build'
 }

任务本身应该配置在 build.xml 中。

The tasks themselves should be configured in the build.xml.