Created
June 22, 2017 19:23
-
-
Save nolte/be1b70bb60e2e8d89e4b6c5d2a318621 to your computer and use it in GitHub Desktop.
List all installed Jenkins Extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jenkins.model.*; | |
import hudson.ExtensionFinder; | |
List<ExtensionFinder> finders = Jenkins.instance.getExtensionList(ExtensionFinder.class); | |
for (finder in finders) { | |
println(">>> " + finder); | |
if (finder instanceof hudson.ExtensionFinder.GuiceFinder) { | |
println(finder.annotations.size()); | |
for (key in finder.annotations.keySet()) { | |
println(key); | |
} | |
} else if (finder instanceof hudson.cli.declarative.CLIRegisterer) { | |
println(finder.discover(Jenkins.instance)); | |
for (extension in finder.discover(Jenkins.instance)) { | |
println("CLI wrapper for " + extension.instance.class); | |
// not sure what to do with those | |
} | |
} else { | |
println("UNKNOWN FINDER TYPE"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment