hudson.model.Hudson.getVersion()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(92)

本文整理了Java中hudson.model.Hudson.getVersion()方法的一些代码示例,展示了Hudson.getVersion()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hudson.getVersion()方法的具体详情如下:
包路径:hudson.model.Hudson
类名称:Hudson
方法名:getVersion

Hudson.getVersion介绍

[英]Parses #VERSION into VersionNumber, or null if it's not parseable as a version number (such as when Hudson is run with "mvn hudson-dev:run")
[中]将#VERSION解析为VersionNumber,如果无法将其解析为版本号,则解析为null(例如当Hudson使用“mvn Hudson dev:run”运行时)

代码示例

代码示例来源:origin: org.jenkins-ci.plugins/publish-over

public static final boolean missing(final VersionNumber version) {
  return Hudson.getVersion().isOlderThan(version);
}

代码示例来源:origin: org.eclipse.hudson/hudson-service

public String getVersion() {
  return Hudson.getVersion().toString();
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-service

public String getVersion()
{
  return Hudson.getVersion().toString();
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

public DNSMultiCast(Hudson hudson) {
  if (disabled)   return; // escape hatch
  
  try {
    this.jmdns = JmDNS.create();
    Map<String,String> props = new HashMap<String, String>();
    String rootURL = hudson.getRootUrl();
    if (rootURL!=null)
      props.put("url", rootURL);
    try {
      props.put("version",String.valueOf(Hudson.getVersion()));
    } catch (IllegalArgumentException e) {
      // failed to parse the version number
    }
    TcpSlaveAgentListener tal = hudson.getTcpSlaveAgentListener();
    if (tal!=null)
      props.put("slave-port",String.valueOf(tal.getPort()));
    jmdns.registerService(ServiceInfo.create("_hudson._tcp.local.","hudson",
        80,0,0,props));
  } catch (IOException e) {
    LOGGER.log(Level.WARNING,"Failed to advertise the service to DNS multi-cast",e);
  }
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

public boolean isNewerCoreRequired(AvailablePluginInfo availablePlugin) {
  if (availablePlugin.getRequiredCoreVersion() != null) {
    return Hudson.getVersion().isOlderThan(availablePlugin.getRequiredCoreVersion());
  }
  return false;
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

public DNSMultiCast(Hudson hudson) {
  if (disabled)   return; // escape hatch
  
  try {
    this.jmdns = JmDNS.create();
    Map<String,String> props = new HashMap<String, String>();
    String rootURL = hudson.getRootUrl();
    if (rootURL!=null)
      props.put("url", rootURL);
    try {
      props.put("version",String.valueOf(Hudson.getVersion()));
    } catch (IllegalArgumentException e) {
      // failed to parse the version number
    }
    TcpSlaveAgentListener tal = hudson.getTcpSlaveAgentListener();
    if (tal!=null)
      props.put("slave-port",String.valueOf(tal.getPort()));
    jmdns.registerService(ServiceInfo.create("_hudson._tcp.local.","hudson",
        80,0,0,props));
  } catch (IOException e) {
    LOGGER.log(Level.WARNING,"Failed to advertise the service to DNS multi-cast",e);
  }
}

代码示例来源:origin: hudson/hudson-2.x

public DNSMultiCast(Hudson hudson) {
  if (disabled)   return; // escape hatch
  
  try {
    this.jmdns = JmDNS.create();
    Map<String,String> props = new HashMap<String, String>();
    String rootURL = hudson.getRootUrl();
    if (rootURL!=null)
      props.put("url", rootURL);
    try {
      props.put("version",String.valueOf(Hudson.getVersion()));
    } catch (IllegalArgumentException e) {
      // failed to parse the version number
    }
    TcpSlaveAgentListener tal = hudson.getTcpSlaveAgentListener();
    if (tal!=null)
      props.put("slave-port",String.valueOf(tal.getPort()));
    jmdns.registerService(ServiceInfo.create("_hudson._tcp.local.","hudson",
        80,0,0,props));
  } catch (IOException e) {
    LOGGER.log(Level.WARNING,"Failed to advertise the service to DNS multi-cast",e);
  }
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

public DNSMultiCast(Hudson hudson) {
  if (disabled) {
    return; // escape hatch
  }
  try {
    this.jmdns = JmDNS.create();
    Map<String, String> props = new HashMap<String, String>();
    String rootURL = hudson.getRootUrl();
    if (rootURL != null) {
      props.put("url", rootURL);
    }
    try {
      props.put("version", String.valueOf(Hudson.getVersion()));
    } catch (IllegalArgumentException e) {
      // failed to parse the version number
    }
    TcpSlaveAgentListener tal = hudson.getTcpSlaveAgentListener();
    if (tal != null) {
      props.put("slave-port", String.valueOf(tal.getPort()));
    }
    jmdns.registerService(ServiceInfo.create("_hudson._tcp.local.", "hudson",
        80, 0, 0, props));
  } catch (IOException e) {
    LOGGER.log(Level.WARNING, "Failed to advertise the service to DNS multi-cast", e);
  }
}

代码示例来源:origin: com.marvelution.jira.plugins/hudson-apiv2-plugin

/**
 * {@inheritDoc}
 */
@Override
public Version getVersion() {
  // At-least READ access is required to view this
  if (!Hudson.getInstance().hasPermission(Hudson.READ)) {
    throw new ForbiddenException();
  }
  HudsonSystem system = HudsonSystem.getHudsonSystem();
  log.fine("Request for Plugin information returned: " + system.name() + ", " + Hudson.getVersion().toString());
  return new Version(system, Hudson.getVersion().toString(), HudsonPluginUtils.getPluginVersion(),
      HudsonPluginUtils.getPluginGroupId(), HudsonPluginUtils.getPluginArifactId());
}

代码示例来源:origin: jenkinsci/thin-backup-plugin

private PluginList getInstalledPlugins() {
 final File pluginVersionList = new File(backupDirectory, INSTALLED_PLUGINS_XML);
 final PluginList newPluginList = new PluginList(pluginVersionList);
 final Hudson hudson = Hudson.getInstance();
 if (hudson != null) {
  newPluginList.add("Hudson core", Hudson.getVersion().toString());
 }
 final List<PluginWrapper> installedPlugins;
 if (hudson != null) {
  installedPlugins = hudson.getPluginManager().getPlugins();
 } else {
  installedPlugins = Collections.emptyList();
 }
 for (final PluginWrapper pluginWrapper : installedPlugins) {
  newPluginList.add(pluginWrapper.getShortName(), pluginWrapper.getVersion());
 }
 return newPluginList;
}

代码示例来源:origin: com.marvelution.jira.plugins/jenkins-jira-plugin

/**
 * Get the {@link com.marvelution.jenkins.plugins.jira.model.Manifest} of the local instance
 *
 * @param request the {@link javax.servlet.http.HttpServletRequest}, used to determine the application root url
 * @return the Manifest
 * @throws IOException in case of application store loading issues
 */
public static Manifest getOwnManifest(HttpServletRequest request) throws IOException {
  return Manifest.create(URI.create(ApplicationLinkStore.getStore().getApplicationUrl()), Hudson.getVersion().toString(),
      ApplicationLinkStore.getStore().getApplicationName(), Hudson.getInstance().getSecurityRealm().allowsSignup());
}

代码示例来源:origin: jenkinsci/artifactory-plugin

debuggingLogger.fine("Getting root build");
this.rootBuild = BuildUniqueIdentifierHelper.getRootBuild(mavenModuleSetBuild);
this.isArchiveJenkinsVersion = Hudson.getVersion().isNewerThan(new VersionNumber(
    HIGHEST_VERSION_BEFORE_ARCHIVE_FIX));

相关文章

微信公众号

最新文章

更多

Hudson类方法