jenkins管道git签出不工作

jenkins管道git签出不工作,git,jenkins,jenkins-pipeline,Git,Jenkins,Jenkins Pipeline,我有一个管道阶段,在那里我从Bitbucket/GIT签出代码,但是,除了代码没有被签出之外,一切看起来都很好 我的结帐片段 stage('SCM Checkout of Reporting Service'){ steps { checkout([ $class: 'GitSCM', branches: [[name: '*/develop']], doGenerat

我有一个管道阶段,在那里我从Bitbucket/GIT签出代码,但是,除了代码没有被签出之外,一切看起来都很好

我的结帐片段

stage('SCM Checkout of Reporting Service'){
      steps {
          checkout([
                $class: 'GitSCM',
                branches: [[name: '*/develop']],
                doGenerateSubmoduleConfigurations: false, 
                extensions: [], 
                submoduleCfg: [], 
                userRemoteConfigs: [[credentialsId: 'e37898cc-9e67-4b26-8382-998fa5ebb79f', url: 'ssh://git@adlm.org.com:7999/~raja8008/ad-service.git']]
            ])

      }
    }
当在Jenkins中执行上述操作时,我会看到下面的日志,其中没有代码被签出,我的后续阶段在这方面失败

[Pipeline] { (SCM Checkout of Reporting Service)
[Pipeline] checkout
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url ssh://git@adlm.org.com:7999/~raja8008/ad-service.git # timeout=10
Cleaning workspace
 > git rev-parse --verify HEAD # timeout=10
Resetting working tree
 > git reset --hard # timeout=10
 > git clean -fdx # timeout=10
Fetching upstream changes from ssh://git@adlm.org.com:7999/~raja8008/ad-service.git
 > git --version # timeout=10
using GIT_ASKPASS to set credentials 
 > git fetch --tags --progress ssh://git@adlm.org.com:7999/~raja8008/ad-service.git +refs/heads/*:refs/remotes/origin/*
 > git rev-parse refs/remotes/origin/develop^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/origin/develop^{commit} # timeout=10
Checking out Revision d25889e0eb6c52bfe4dd6a5c76e9bdaadd941924 (refs/remotes/origin/develop)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f d25889e0eb6c52bfe4dd6a5c76e9bdaadd941924
Commit message: "Merge pull request #3 in ADDD/ad-service from ~RAJA8008/ad-service:develop to develop"
 > git rev-list --no-walk d25889e0eb6c52bfe4dd6a5c76e9bdaadd941924 # timeout=10
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build Reporting Service)
[Pipeline] dir
Running in /temp/workspace/testadexp/ad-service
[Pipeline] {
[Pipeline] sh
[ad-service] Running shell script
+ ls -lah
total 8.0K
drwxr-xr-x.  2 1009100 25198 4.0K Oct  5 05:18 .
drwxr-xr-x. 10 1009100 25198 4.0K Oct  5 05:18 ..
[Pipeline] sh
[ad-service] Running shell script
+ mvn clean install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.107 s
[INFO] Finished at: 2018-10-05T05:18:29Z
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/temp/workspace/testadexp/ad-service). Please verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 

这里的问题是什么?

您可以使用声明性语法签出存储库(因为您使用的是stage)


它给出的日志与我在问题中发布的日志相同。没有签出任何内容。能否显示整个管道(签出以及检查工作区中内容的下一个阶段)是的,我在新创建的目录中运行命令时出错了。@Ivthillo如何签出特定标记?然后可以使用以下命令:签出scm:[$class:'GitSCM',userRemoteConfigs:[[url:repoURL,CredentialId:credential]],分支:[[name:tag version]],轮询:false
    stage('Checkout') {
        steps {
            git branch: 'develop', credentialsId: 'xxxx', url: 'ssh://git@server/project.git'
        }
    }