use of hudson.PluginWrapper in project dependency-check-plugin by jenkinsci.
the class AbstractDependencyCheckBuilder method perform.
/**
* This method is called whenever the build step is executed.
*/
@Override
public void perform(@Nonnull final Run<?, ?> build, @Nonnull final FilePath filePath, @Nonnull final Launcher launcher, @Nonnull final TaskListener listener) throws InterruptedException, IOException {
// Determine if the build should be skipped or not
if (isSkip(build, listener)) {
build.setResult(Result.SUCCESS);
return;
}
// Get the version of the plugin and print it out
final PluginWrapper wrapper = Jenkins.getInstance().getPluginManager().getPlugin(DependencyCheckDescriptor.PLUGIN_ID);
listener.getLogger().println(OUT_TAG + wrapper.getLongName() + " v" + wrapper.getVersion());
final ClassLoader classLoader = wrapper.classLoader;
final boolean isMaster = build.getExecutor().getOwner().getNode() == Jenkins.getInstance();
// Node-agnostic execution of Dependency-Check
boolean success;
if (isMaster) {
success = launcher.getChannel().call(new DependencyCheckExecutor(options, listener, classLoader));
} else {
success = launcher.getChannel().call(new DependencyCheckExecutor(options, listener));
}
if (success) {
build.setResult(Result.SUCCESS);
} else {
build.setResult(Result.FAILURE);
}
}
use of hudson.PluginWrapper in project support-core-plugin by jenkinsci.
the class AboutJenkins method addContents.
@Override
public void addContents(@NonNull Container container) {
List<PluginWrapper> activePlugins = new ArrayList<PluginWrapper>();
List<PluginWrapper> disabledPlugins = new ArrayList<PluginWrapper>();
populatePluginsLists(activePlugins, disabledPlugins);
container.add(new AboutContent(activePlugins));
container.add(new ItemsContent());
container.add(new NodesContent());
container.add(new ActivePlugins(activePlugins));
container.add(new DisabledPlugins(disabledPlugins));
container.add(new FailedPlugins());
container.add(new Dockerfile(activePlugins, disabledPlugins));
container.add(new MasterChecksumsContent());
for (final Node node : Jenkins.getInstance().getNodes()) {
container.add(new NodeChecksumsContent(node));
}
}
use of hudson.PluginWrapper in project promoted-builds-plugin by jenkinsci.
the class JobDslPromotionProcessConverter method obtainClassOwnership.
@CheckForNull
private String obtainClassOwnership() {
if (this.classOwnership != null) {
return this.classOwnership;
}
if (pm == null) {
Jenkins j = Jenkins.getInstanceOrNull();
pm = j != null ? j.getPluginManager() : null;
}
if (pm == null) {
return null;
}
// TODO: possibly recursively scan super class to discover dependencies
PluginWrapper p = pm.whichPlugin(hudson.plugins.promoted_builds.PromotionProcess.class);
this.classOwnership = p != null ? p.getShortName() + '@' + trimVersion(p.getVersion()) : null;
return this.classOwnership;
}
use of hudson.PluginWrapper in project promoted-builds-plugin by jenkinsci.
the class GroovyConditionDescriptor method isApplicable.
@Override
public boolean isApplicable(final AbstractProject<?, ?> item) {
final PluginManager pluginManager = Jenkins.get().getPluginManager();
final PluginWrapper plugin = pluginManager.getPlugin("script-security");
return plugin != null && plugin.isActive();
}
Aggregations