/** * Provides the list of platform plugin updates from the last time * the upgrade was run. * @return {@code null} if the version range cannot be retrieved. */ @CheckForNull public JSONArray getPlatformPluginUpdates() { final VersionNumber version = getCurrentLevel(); if (version == null) { return null; } return getPlatformPluginsForUpdate(version, Jenkins.getVersion()); }
private Object buildComponentInformation() { Map<String, String> components = new TreeMap<>(); VersionNumber core = Jenkins.getVersion(); components.put("jenkins-core", core == null ? "" : core.toString()); for (PluginWrapper plugin : Jenkins.get().pluginManager.getPlugins()) { if (plugin.isActive()) { components.put(plugin.getShortName(), plugin.getVersion()); } } return components; }
public String getCss() { final VersionNumber version = Jenkins.getVersion(); if (version == null || version.isNewerThan(new VersionNumber("2.103"))) { return "alert alert-warning"; } return "warning"; } }
props.put("version",String.valueOf(Jenkins.getVersion())); } catch (IllegalArgumentException e) {
/*package*/ void completeSetup() throws IOException, ServletException { Jenkins.get().checkPermission(Jenkins.ADMINISTER); InstallUtil.saveLastExecVersion(); setCurrentLevel(Jenkins.getVersion()); InstallUtil.proceedToNextStateFrom(InstallState.INITIAL_SETUP_COMPLETED); }
if (lastExecVersion.isNewerThan(InstallUtil.NEW_INSTALL_VERSION) && lastExecVersion.isOlderThan(Jenkins.getVersion())) {
LOGGER.warning(shortName + " doesn't declare required core version."); } else { VersionNumber actualVersion = Jenkins.getVersion(); if (actualVersion.isOlderThan(new VersionNumber(requiredCoreVersion))) { versionDependencyError(Messages.PluginWrapper_obsoleteCore(Jenkins.getVersion().toString(), requiredCoreVersion), Jenkins.getVersion().toString(), requiredCoreVersion);
/** * Returns true if this warning is relevant to the current configuration * @return true if this warning is relevant to the current configuration */ public boolean isRelevant() { switch (this.type) { case CORE: VersionNumber current = Jenkins.getVersion(); if (!isRelevantToVersion(current)) { return false; } return true; case PLUGIN: // check whether plugin is installed PluginWrapper plugin = Jenkins.getInstance().getPluginManager().getPlugin(this.component); if (plugin == null) { return false; } // check whether warning is relevant to installed version VersionNumber currentCore = plugin.getVersionNumber(); if (!isRelevantToVersion(currentCore)) { return false; } return true; case UNKNOWN: default: return false; } }
info.put("core", Jenkins.getVersion().toString()); info.put("clientDate", clientDateString()); info.put("properties", security);
setCurrentLevel(Jenkins.getVersion());
private static String getJenkinsVersion() { final VersionNumber jenkinsVersion = Jenkins.getVersion(); if (jenkinsVersion != null) { return jenkinsVersion.toString(); } else { return UNKNOWN; } }
/** * Provides the list of platform plugin updates from the last time * the upgrade was run. * @return {@code null} if the version range cannot be retrieved. */ @CheckForNull public JSONArray getPlatformPluginUpdates() { final VersionNumber version = getCurrentLevel(); if (version == null) { return null; } return getPlatformPluginsForUpdate(version, Jenkins.getVersion()); }
final VersionNumber version = Jenkins.getVersion(); if (version == null) {
public String getCss() { final VersionNumber version = Jenkins.getVersion(); if (version == null || version.isNewerThan(new VersionNumber("2.103"))) { return "alert alert-warning"; } return "warning"; } }
public boolean isNewJenkins() { final VersionNumber matrixBreakOutVersion = new VersionNumber("1.560"); return Jenkins.getVersion().isNewerThan(matrixBreakOutVersion); }
private void initializeProperties(final Map<String, String> properties) { properties.put(PROPERTY_USER_ID, getUserId()); // Get Jenkins version info properties.put(PROPERTY_JENKINS_VERSION, Jenkins.getVersion().toString()); properties.put(PROPERTY_PLUGIN_VERSION, getPluginVersion()); // Get OS info properties.put(PROPERTY_LOCALE, getLocaleName()); properties.put(PROPERTY_OS_PLATFORM, getPlatformName()); properties.put(PROPERTY_OS_VERSION, getPlatformVersion()); // Get Java info properties.put(PROPERTY_JAVA_NAME, getJavaName()); properties.put(PROPERTY_JAVA_VERSION, getJavaVersion()); }
/** * @return true if this version of the plugin is running on a Jenkins version where JENKINS-43786 is included. */ @Restricted(DoNotUse.class) public boolean isTheNewDesignAvailable() { final VersionNumber version = Jenkins.getVersion(); if (version != null && version.isNewerThan(new VersionNumber("2.103"))) { return true; } return false; }
/** * Gets the full User Agent used to make requests to TFS/Team Services. */ public String getUserAgent(final String defaultUserAgent) { try { return MessageFormat.format(USER_AGENT_FORMAT, PRODUCT_NAME, getPluginVersion(), "Jenkins", Jenkins.getVersion(), getPlatformName(), getPlatformVersion(), getJavaName(), getJavaVersion(), defaultUserAgent); } catch (final Throwable t) { logger.warn("Error getting UserAgent", t); return defaultUserAgent; } }
/*package*/ void completeSetup() throws IOException, ServletException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); InstallUtil.saveLastExecVersion(); setCurrentLevel(Jenkins.getVersion()); PluginServletFilter.removeFilter(FORCE_SETUP_WIZARD_FILTER); isUsingSecurityToken = false; // this should not be considered new anymore InstallUtil.proceedToNextStateFrom(InstallState.INITIAL_SETUP_COMPLETED); }
/** * Returns true if this warning is relevant to the current configuration * @return true if this warning is relevant to the current configuration */ public boolean isRelevant() { switch (this.type) { case CORE: VersionNumber current = Jenkins.getVersion(); if (!isRelevantToVersion(current)) { return false; } return true; case PLUGIN: // check whether plugin is installed PluginWrapper plugin = Jenkins.getInstance().getPluginManager().getPlugin(this.component); if (plugin == null) { return false; } // check whether warning is relevant to installed version VersionNumber currentCore = plugin.getVersionNumber(); if (!isRelevantToVersion(currentCore)) { return false; } return true; case UNKNOWN: default: return false; } }