正在为ANT从GIT寻找一个声明性jenkins文件,以从GIT构建Java项目并将其部署到tomcat服务器。
任何指针都会受到赞赏
我尝试了以下代码,但失败了
pipeline {
agent any
stages {
stage('SCM Checkout'){
git 'https://github.com/prakashk0301/maven-project'
}
}
{
stage ('Compile Stage') {
steps {
withAnt(installation : 'ANT', jdk: 'JDK') {
sh 'ant -f /usr/share/ant/build.xml clean compile'
}
}
}
stage ('Create War Stage') {
steps {
withAnt(installation : 'ANT', jdk: 'JDK') {
sh 'ant -f /usr/share/ant/build.xml war'
}
}
}
}
}