当前位置: 首页>>代码示例>>Java>>正文


Java Version.toString方法代码示例

本文整理汇总了Java中org.eclipse.aether.version.Version.toString方法的典型用法代码示例。如果您正苦于以下问题:Java Version.toString方法的具体用法?Java Version.toString怎么用?Java Version.toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.aether.version.Version的用法示例。


在下文中一共展示了Version.toString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: determineNewestVersion

import org.eclipse.aether.version.Version; //导入方法依赖的package包/类
private static String determineNewestVersion(RepositorySystem repoSystem, RepositorySystemSession repoSession, List<RemoteRepository>[] repos) throws MojoExecutionException {
  String version;VersionRangeRequest rangeRequest = new VersionRangeRequest();
  rangeRequest.setArtifact(new DefaultArtifact(SDK_GROUP_ID + ":" + SDK_ARTIFACT_ID + ":[0,)"));
  for(List<RemoteRepository> repoList : repos) {
    for(RemoteRepository repo : repoList) {
      rangeRequest.addRepository(repo);
    }
  }

  VersionRangeResult rangeResult;
  try {
    rangeResult = repoSystem.resolveVersionRange(repoSession, rangeRequest);
  } catch (VersionRangeResolutionException e) {
    throw new MojoExecutionException("Could not resolve latest version of the App Engine Java SDK", e);
  }

  List<Version> versions = rangeResult.getVersions();

  Collections.sort(versions);

  Version newest = Iterables.getLast(versions);

  version = newest.toString();
  return version;
}
 
开发者ID:GoogleCloudPlatform,项目名称:appengine-maven-plugin,代码行数:26,代码来源:SdkResolver.java

示例2: resolveLatestVersionRange

import org.eclipse.aether.version.Version; //导入方法依赖的package包/类
private Artifact resolveLatestVersionRange(Dependency dependency, String version) throws MojoExecutionException {
  Matcher versionMatch = matchVersion(version);
  Artifact artifact = new DefaultArtifact(dependency.getGroupId(), dependency.getArtifactId(),
      dependency.getType(), dependency.getClassifier(), version);

  if (versionMatch.matches()) {

    Version highestVersion = highestVersion(artifact);
    String upperVersion = versionMatch.group(1) != null
        ? versionMatch.group(1)
        : "";
    String newVersion = "[" + highestVersion.toString() + "," + upperVersion + ")";

    artifact = artifact.setVersion(newVersion);
    return artifact;
  }
  else {
    return artifact;
  }
}
 
开发者ID:stickycode,项目名称:bounds-maven-plugin,代码行数:21,代码来源:StickyBoundsMojo.java

示例3: latestRelease

import org.eclipse.aether.version.Version; //导入方法依赖的package包/类
public String latestRelease(Artifact artifact) throws VersionRangeResolutionException {
    List<Version> versions;
    Version version;

    versions = availableVersions(artifact.setVersion("[" + artifact.getVersion() + ",]"));

    // ranges also return SNAPSHOTS. The release/compatibility notes say they don't, but the respective bug
    // was re-opened: http://jira.codehaus.org/browse/MNG-3092
    for (int i = versions.size() - 1; i >= 0; i--) {
        version = versions.get(i);
        if (!version.toString().endsWith("SNAPSHOT")) {
            return version.toString();
        }
    }
    return artifact.getVersion();
}
 
开发者ID:mlhartme,项目名称:maven-embedded,代码行数:17,代码来源:Maven.java

示例4: determineNewestVersion

import org.eclipse.aether.version.Version; //导入方法依赖的package包/类
private static String determineNewestVersion(RepositorySystem repoSystem, RepositorySystemSession repoSession,
                                             List<RemoteRepository>[] repos) throws MojoExecutionException {
    String version;
    VersionRangeRequest rangeRequest = new VersionRangeRequest();
    rangeRequest.setArtifact(new DefaultArtifact(SDK_GROUP_ID + ":" + SDK_ARTIFACT_ID + ":[0,)"));
    for (List<RemoteRepository> repoList : repos) {
        for (RemoteRepository repo : repoList) {
            rangeRequest.addRepository(repo);
        }
    }

    VersionRangeResult rangeResult;
    try {
        rangeResult = repoSystem.resolveVersionRange(repoSession, rangeRequest);
    } catch (VersionRangeResolutionException e) {
        throw new MojoExecutionException("Could not resolve latest version of the App Engine Java SDK", e);
    }

    List<Version> versions = rangeResult.getVersions();

    Collections.sort(versions);

    Version newest = Iterables.getLast(versions);

    version = newest.toString();
    return version;
}
 
开发者ID:feroult,项目名称:yawp,代码行数:28,代码来源:SdkResolver.java

示例5: determineNewestVersion

import org.eclipse.aether.version.Version; //导入方法依赖的package包/类
private static String determineNewestVersion(RepositorySystem repoSystem,
    RepositorySystemSession repoSession, List<RemoteRepository>[] repos)
    throws MojoExecutionException {
  String version;
  VersionRangeRequest rangeRequest = new VersionRangeRequest();
  rangeRequest.setArtifact(new DefaultArtifact(SDK_GROUP_ID + ":" + SDK_ARTIFACT_ID + ":[0,)"));
  for (List<RemoteRepository> repoList : repos) {
    for (RemoteRepository repo : repoList) {
      rangeRequest.addRepository(repo);
    }
  }

  VersionRangeResult rangeResult;
  try {
    rangeResult = repoSystem.resolveVersionRange(repoSession, rangeRequest);
  } catch (VersionRangeResolutionException e) {
    throw new MojoExecutionException(
        "Could not resolve latest version of the App Engine Java SDK", e);
  }

  List<Version> versions = rangeResult.getVersions();

  Collections.sort(versions);

  Version newest = Iterables.getLast(versions);

  version = newest.toString();
  return version;
}
 
开发者ID:GoogleCloudPlatform,项目名称:gcloud-maven-plugin,代码行数:30,代码来源:SdkResolver.java

示例6: getNewestVersion

import org.eclipse.aether.version.Version; //导入方法依赖的package包/类
public String getNewestVersion(String groupId, String artifactId) throws VersionRangeResolutionException {
    Artifact artifact = new DefaultArtifact(groupId, artifactId, "jar", "[0,)");

    VersionRangeRequest rangeRequest = new VersionRangeRequest();
    rangeRequest.setArtifact(artifact);
    rangeRequest.setRepositories(repositories);

    VersionRangeResult rangeResult = system.resolveVersionRange( session, rangeRequest );

    Version newestVersion = rangeResult.getHighestVersion();
    
    return newestVersion.toString();
}
 
开发者ID:naver,项目名称:pinpoint,代码行数:14,代码来源:DependencyResolver.java


注:本文中的org.eclipse.aether.version.Version.toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。