Jenkins Scripting Console

13 views
Skip to first unread message

eric....@gmail.com

unread,
Apr 15, 2022, 12:19:10 PM4/15/22
to Jenkins Users
Hi all!  I'm trying to display a few simple things from the console for our security team.  I'm getting the correct answers for all except whether the plugin is enabled or not.  They are all returning enabled for me.  Can someone tell me what I'm doing wrong in my groovy code?

Jenkins.instance.pluginManager.plugins.each{
  plugin ->
  boolean active = ( plugin.isActive() )
  String enabled = ( active == true ? "Enabled" : "Disabled"  )
  println ("${plugin.getDisplayName()} (${plugin.getShortName()}): ${plugin.getVersion()} ${enabled}")
}

Thanks,
Eric

eric....@gmail.com

unread,
Apr 15, 2022, 1:03:11 PM4/15/22
to Jenkins Users
Well my bad, it works fine.  I was thinking the plugins were disabled if they were subdued in color.  No, that just means they can't be disabled.  I didn't have any disabled.  I disabled subversion and it shows Disabled.  Maybe this will help someone down the road, though, who wants to do the same.
Reply all
Reply to author
Forward
0 new messages