本文整理汇总了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;
}
示例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;
}
}
示例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();
}
示例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;
}
示例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;
}
示例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();
}