如何使用Jenkins构建基本的Pipeline

问题描述 投票:0回答:1

我尝试使用Pipeline脚本,直到最后一步才到达。

enter image description here

Pipeline脚本是以下代码

node{
  stage ('Build') {

    git url: 'https://[email protected]/xxx/01-eureka.git'

    withMaven(
        // Maven installation declared in the Jenkins "Global Tool Configuration"
        maven: 'M3',
        // Maven settings.xml file defined with the Jenkins Config File Provider Plugin
        // Maven settings and global settings can also be defined in Jenkins Global Tools Configuration
        mavenSettingsConfig: 'my-maven-settings',
        mavenLocalRepo: '.repository') {

      // Run the maven build
      sh "mvn clean install"

    } // withMaven will discover the generated Maven artifacts, JUnit Surefire & FailSafe & FindBugs reports...
  }
}

我已经配置了maven和Java。

我不知道最后一步的错误,我更新了所有代码。

jenkins jenkins-pipeline
1个回答
0
投票

我不认为ENV是你的,但首先,你应该检查你的Jenkins工作区文件夹Jenkins \ workspace \ docker-app,看看git clone是否按预期工作

如果源代码在那里,手动运行maven命令以查看Maven是否正确找到了pom.xml

© www.soinside.com 2019 - 2024. All rights reserved.