在没有Classpath字段的情况下在Jenkins中加载自定义jar文件(Loading Custom jar files in Jenkins without the Classpath Fiel

编程入门 行业动态 更新时间:2024-10-26 05:22:21
在没有Classpath字段的情况下在Jenkins中加载自定义jar文件(Loading Custom jar files in Jenkins without the Classpath Field)

如何在没有 classpath字段的情况下为我的Jenkins Jobs DSL groovy脚本加载自定义jar文件?

我继承了一个Jenkins实例。 这个Jenkins实例有一个旧版本的Jenkins Jobs DSL插件 。 此版本的jobs插件具有类路径字段

通过加载此jar文件,我的脚本(在DSL脚本中)具有可导入的其他符号/类。

但是, Jenkins Jobs DSL的最新版本已删除此类路径字段。 我从邮件列表中得到的印象是这是出于安全原因。

没有这个选项,是否可以设置不同的类路径(或者在我的Jenkins Jobs DSL groovy脚本中包含额外的jar文件而没有这个字段?

How can I load a custom jar file for my Jenkins Jobs DSL groovy scripts without the classpath field?

I've inherited a Jenkins instance. This Jenkins instance has an older version of the Jenkins Jobs DSL plugin. This version of the jobs plugin has a class path fields

By loading this jar file, my script (in the DSL Scripts) has additional symbols/classes it may import.

However, the latest versions of the Jenkins Jobs DSL have removed this class path field. The impression I get from the mailing list) is this was done for security reasons.

Without this option, is it possible to set a different class path (or include extra jar files in my Jenkins Jobs DSL groovy scripts without this field?

最满意答案

不,没有任何直接选择。 以下是可用的选项

选项1 :按照Daniel的建议( https://groups.google.com/forum/#!topic/job-dsl-plugin/lYgX3boW0Pk ),您可以使用Script Security Plugin添加自定义类路径并包含jar(s )。 这种方法唯一的开销就是,即使罐子中存在细微差别,也需要批准。

选项2 (最不推荐,最后一个选项):如果您在公司网络下运行Jenkins,并且您对安全性有信心,那么您可以考虑取消选中Jenkins的启用安全工作DSL - >配置全局安全 在这里输入图像描述

No, there isn't any direct option available. Following are the options available

Option 1: As Daniel has suggested (https://groups.google.com/forum/#!topic/job-dsl-plugin/lYgX3boW0Pk) , you can use the Script Security Plugin to add custom classpath and include the jar(s). The only overhead with this approach is, even if there is a minor difference in the jar, an approval would be required.

Option 2(Least Preferred, Last Option): If you are running Jenkins under a company network and if your confident on security, then you can consider to uncheck the Enable Security for Job DSL from Jenkins-> Configure Global Secutiry enter image description here

更多推荐

本文发布于:2023-08-04 15:29:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1417788.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自定义   字段   情况下   加载   文件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!