jenkins发布应用到k8s报ERROR: ERROR: Can't construct a java object for tag:yaml.org,2002

jenkins发布应用到k8s报下面的错,有兄弟说可以把Jackson 2 API除到2.10.3,可这个版本一降下来其它插件就无法使用,大家是怎么解决这个问题的呢?求救
Loading configuration: /var/lib/jenkins/workspace/mss-zuul-test/deployment.yaml
ERROR: ERROR: Can’t construct a java object for tag:yaml.org,2002:io.kubernetes.client.openapi.models.ExtensionsV1beta1Deployment; exception=Class not found: io.kubernetes.client.openapi.models.ExtensionsV1beta1Deployment
in ‘reader’, line 1, column 1:
apiVersion: extensions/v1beta1
^

hudson.remoting.ProxyException: Can’t construct a java object for tag:yaml.org,2002:io.kubernetes.client.openapi.models.ExtensionsV1beta1Deployment; exception=Class not found: io.kubernetes.client.openapi.models.ExtensionsV1beta1Deployment
in ‘reader’, line 1, column 1:
apiVersion: extensions/v1beta1
^

at org.yaml.snakeyaml.constructor.Constructor$ConstructYamlObject.construct(Constructor.java:335)
at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:229)
at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:219)
at io.kubernetes.client.util.Yaml$CustomConstructor.constructObject(Yaml.java:337)

有兄弟发贴说可以用下面的方案解决,但是代码根本就没有 jackson2-api-2.11.2分支的代码 ?

解决方案:

拉取github代码:
git clone https://github.com/jenkinsci/jackson2-api-plugin
git checkout jackson2-api-2.11.2
删除
https://github.com/jenkinsci/jackson2-api-plugin/commit/cbbdf36843505efd5d2d7cd4769018e4cc09f450
这次提交的内容

在maven 的setting.xml里面添加:

抱歉在我帖子上没描述清楚, jackson2-api-2.11.2 不是分支,是tag ,直接按照我帖子上的命令复制粘贴执行修改即可

1赞