我正在努力加载gitlab管道库。
这是我的配置:
myLib = library (identifier: 'app@master', retriever: modernSCM(
[$class: 'GitSCM',
branches:[[name: "master"]],
remote: 'https://my-url.com/git/orga/Jenkins-libs.git',
credentialsId: 'aaaaaaa-8f3f-4e3c-8ade-6c77351e7872',
includes: '*'
])
)
master分支存在,但Jenkins一直在进行NPE:
Fetching & pruning origin...
Fetching upstream changes from origin
> git --version # timeout=10
using GIT_ASKPASS to set credentials
> git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* --prune
Getting remote branches...
Seen branch in repository origin/master
Seen branch in repository origin/test
Seen 2 remote branches
Checking branch test
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
java.lang.NullPointerException
at jenkins.plugins.git.AbstractGitSCMSource.getPattern(AbstractGitSCMSource.java:439)
at jenkins.plugins.git.AbstractGitSCMSource.isExcluded(AbstractGitSCMSource.java:428)
at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:306)
at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:371)
at jenkins.scm.api.SCMSource.retrieve(SCMSource.java:616)
at jenkins.scm.api.SCMSource.fetch(SCMSource.java:598)
有人对此事有任何线索吗? Jenkins使用的:2.7.4
关于, 纪尧姆
答案 0 :(得分:0)
发现了自己的问题:我必须用一个哑数值定义'excludes'参数,否则要定义其NPE。 Jenkins 2.7.4不使用以下代码版本:https://github.com/jenkinsci/git-plugin/blob/769e7ed3e3971ac4b7c25de60decfbc9f1ea6945/src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java#L204