如何删除“系统属性”在詹金斯通过脚本控制台

发布于 2025-02-11 09:18:45 字数 1175 浏览 1 评论 0 原文

在Jenkins中,可以使用所谓的“系统属性”自定义/参数化应用程序。 您可以设法设置属性如下:

system.setproperty(“ hudson.plugins.active_directory.activerivedirectorysectorysecurityrealm.forceldaps”,“ true”)

在控制台中, 代码>和 system.getProperty 可以看到该值,在这种情况下为 true 。您还可以在URL中的/systemInfo 导航时在页面本身上查看此内容。

是否可以通过代码删除系统属性?我搜索了我发现的另一个主题自2012 - 2013年以来,问题也已经死了。

我尝试了以下操作,不幸的是没有成功:

  1. system.getProperty(“ hudson.plugins.active_directory.activedirectorysectorysecurityrealm.forceldaps”)。
  2. ActivedirectorySecurityRealM.ForcelDaps”)
  3. system.setProperty(“ hudson.plugins.active_directory.activeirectorysectorysectorysectorysectorysecurityrealm.forceldaps”,null) system.setsemperty(setsemperty
  4. ) forceldaps”,未定义)

对任何帮助都表示赞赏。

In Jenkins it is possible to customise/parameterise the application with so called "System Properties". In the console you can manage to set properties like the following:

System.setProperty("hudson.plugins.active_directory.ActiveDirectorySecurityRealm.forceLdaps", "true")

With the code of println and System.getProperty it is possible to see the value, which in this case is true. You can also view this on the page itself when navigating to /systemInfo in the URL.

Is it possible to remove the System Property by code? I searched the documentation of Jenkins but no luck. Another topic I found with the same problem is dead since 2012-2013.

I tried the following, unfortunately without success:

  1. System.getProperty("hudson.plugins.active_directory.ActiveDirectorySecurityRealm.forceLdaps").remove()
  2. System.removeProperty("hudson.plugins.active_directory.ActiveDirectorySecurityRealm.forceLdaps")
  3. System.setProperty("hudson.plugins.active_directory.ActiveDirectorySecurityRealm.forceLdaps", null)
  4. System.setProperty("hudson.plugins.active_directory.ActiveDirectorySecurityRealm.forceLdaps", undefined)

Any help is appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

囍笑 2025-02-18 09:18:45

我自己发现了问题:

您可以使用 system.clearproperty(String键)删除系统参数,这是我以前从未使用过的选项。

希望这对他人有好处。

干杯。

I have found the problem by myself:

You can use System.clearProperty(String key) to remove the System Parameter, the option I didn't used before.

Hopefully this can be a good use for other people.

Cheers.

对不⑦ 2025-02-18 09:18:45

如果您通过脚本控制台添加了该属性,重新启动Jenkins会将其删除。

sudo systemctl restart jenkins 

If you added the property via Script Console, restarting Jenkins would remove it.

sudo systemctl restart jenkins 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文