在Jenkins中,可以使用所谓的“系统属性”自定义/参数化应用程序。 您可以设法设置属性如下:
system.setproperty(“ hudson.plugins.active_directory.activerivedirectorysectorysecurityrealm.forceldaps”,“ true”)
在控制台中, 代码>和 system.getProperty
可以看到该值,在这种情况下为 true
。您还可以在URL中的/systemInfo
导航时在页面本身上查看此内容。
是否可以通过代码删除系统属性?我搜索了我发现的另一个主题自2012 - 2013年以来,问题也已经死了。
我尝试了以下操作,不幸的是没有成功:
- system.getProperty(“ hudson.plugins.active_directory.activedirectorysectorysecurityrealm.forceldaps”)。
-
ActivedirectorySecurityRealM.ForcelDaps”)
-
system.setProperty(“ hudson.plugins.active_directory.activeirectorysectorysectorysectorysectorysecurityrealm.forceldaps”,null)
system.setsemperty(setsemperty
- ) 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:
System.getProperty("hudson.plugins.active_directory.ActiveDirectorySecurityRealm.forceLdaps").remove()
System.removeProperty("hudson.plugins.active_directory.ActiveDirectorySecurityRealm.forceLdaps")
System.setProperty("hudson.plugins.active_directory.ActiveDirectorySecurityRealm.forceLdaps", null)
System.setProperty("hudson.plugins.active_directory.ActiveDirectorySecurityRealm.forceLdaps", undefined)
Any help is appreciated.
发布评论
评论(2)
我自己发现了问题:
您可以使用
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.
如果您通过脚本控制台添加了该属性,重新启动Jenkins会将其删除。
If you added the property via Script Console, restarting Jenkins would remove it.