Skip to content

Commit

Permalink
Merge pull request #9 from jenkinsci/list-all-plugins
Browse files Browse the repository at this point in the history
List all plugins, also not used by jobs
  • Loading branch information
michallaskowski committed Apr 20, 2018
2 parents c8c213a + a3a990d commit 8043cab
Showing 1 changed file with 12 additions and 1 deletion.
Expand Up @@ -27,7 +27,8 @@ public JobCollector() {
public HashMap<PluginWrapper, JobsPerPlugin> getJobsPerPlugin()
{
HashMap<PluginWrapper, JobsPerPlugin> mapJobsPerPlugin = new HashMap<PluginWrapper, JobsPerPlugin>();
List<AbstractProject> allItems = Jenkins.getInstance().getAllItems(AbstractProject.class);
Jenkins jenkins = Jenkins.getInstance();
List<AbstractProject> allItems = jenkins.getAllItems(AbstractProject.class);

for(AbstractProject item: allItems)
{
Expand All @@ -36,6 +37,16 @@ public HashMap<PluginWrapper, JobsPerPlugin> getJobsPerPlugin()
analyser.doJobAnalyze(item, mapJobsPerPlugin);
}
}

List<PluginWrapper> allPlugins = jenkins.getPluginManager().getPlugins();
for(PluginWrapper plugin: allPlugins)
{
if (mapJobsPerPlugin.get(plugin) == null)
{
mapJobsPerPlugin.put(plugin, new JobsPerPlugin(plugin));
}
}

return mapJobsPerPlugin;
}

Expand Down

0 comments on commit 8043cab

Please sign in to comment.