环境:MAC X OS 10.12.3 + Jenkins 2.47
1. 新建一个项目,类型选择 Pipeline
2. 配置 Pipeline
https://github.com/TTFHW/jenkins_pipeline_java_maven.git
3. Build
4. 查看 Jenkinsfile
node {
// Mark the code checkout 'stage'....
stage 'Checkout'
git url: 'https://github.com/TTFHW/jenkins_pipeline_java_maven.git'
// Get the maven tool.
// ** NOTE: This 'M3' maven tool must be configured
// ** in the global configuration.
def mvnHome = tool 'M3'
// Mark the code build 'stage'....
stage 'Build'
// Run the maven build
sh "${mvnHome}/bin/mvn -Dmaven.test.failure.ignore clean package"
step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*.xml'])
}
参考文献:
1. https://github.com/TTFHW
1. 新建一个项目,类型选择 Pipeline
2. 配置 Pipeline
https://github.com/TTFHW/jenkins_pipeline_java_maven.git
3. Build
4. 查看 Jenkinsfile
node {
// Mark the code checkout 'stage'....
stage 'Checkout'
git url: 'https://github.com/TTFHW/jenkins_pipeline_java_maven.git'
// Get the maven tool.
// ** NOTE: This 'M3' maven tool must be configured
// ** in the global configuration.
def mvnHome = tool 'M3'
// Mark the code build 'stage'....
stage 'Build'
// Run the maven build
sh "${mvnHome}/bin/mvn -Dmaven.test.failure.ignore clean package"
step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*.xml'])
}
参考文献:
1. https://github.com/TTFHW
没有评论:
发表评论