且构网

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

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

更新时间:2023-12-05 15:45:34

调用 ant 就像使用 maven 一样(查看示​​例 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.