本文整理汇总了Java中org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl.getRuntimeAPIVersion方法的典型用法代码示例。如果您正苦于以下问题:Java AddonRepositoryImpl.getRuntimeAPIVersion方法的具体用法?Java AddonRepositoryImpl.getRuntimeAPIVersion怎么用?Java AddonRepositoryImpl.getRuntimeAPIVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl
的用法示例。
在下文中一共展示了AddonRepositoryImpl.getRuntimeAPIVersion方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findCompatibleInstalledModule
import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //导入方法依赖的package包/类
private ModuleIdentifier findCompatibleInstalledModule(AddonId addonId)
{
ModuleIdentifier result = null;
Addon addon = currentAddon.get();
Version runtimeAPIVersion = AddonRepositoryImpl.getRuntimeAPIVersion();
for (AddonRepository repository : stateManager.getViewsOf(addon).iterator().next().getRepositories())
{
List<AddonId> enabled = repository.listEnabledCompatibleWithVersion(runtimeAPIVersion);
for (AddonId id : enabled)
{
if (id.getName().equals(addonId.getName()))
{
result = moduleCache.getModuleId(addon);
break;
}
}
}
return result;
}
示例2: getVersion
import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //导入方法依赖的package包/类
@Override
public Version getVersion()
{
return AddonRepositoryImpl.getRuntimeAPIVersion();
}
示例3: getVersion
import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //导入方法依赖的package包/类
@Override
public Version getVersion()
{
return AddonRepositoryImpl.getRuntimeAPIVersion() == null ? null : AddonRepositoryImpl.getRuntimeAPIVersion();
}
示例4: install
import org.jboss.forge.furnace.impl.addons.AddonRepositoryImpl; //导入方法依赖的package包/类
void install(String coordinates, boolean batchMode)
{
Version runtimeAPIVersion = AddonRepositoryImpl.getRuntimeAPIVersion();
try
{
AddonDependencyResolver resolver = new MavenAddonDependencyResolver();
AddonManagerImpl addonManager = new AddonManagerImpl(furnace, resolver);
AddonId addonId;
coordinates = convertColonVersionToComma(coordinates);
// This allows windup --install maven
if (coordinates.matches(artifactWithCommaVersionPattern))
{
addonId = AddonId.fromCoordinates(coordinates);
}
else if (coordinates.matches(artifactPattern))
{
AddonId[] versions = resolver.resolveVersions(coordinates).get();
String coordinate = coordinates;
if (versions.length == 0)
{
throw new IllegalArgumentException("No Artifact version found for " + coordinate);
}
else
{
AddonId selected = null;
for (int i = versions.length - 1; selected == null && i >= 0; i--)
{
String apiVersion = resolver.resolveAPIVersion(versions[i]).get();
if (apiVersion != null
&& Versions.isApiCompatible(runtimeAPIVersion, SingleVersion.valueOf(apiVersion)))
{
selected = versions[i];
}
}
if (selected == null)
{
throw new IllegalArgumentException("No compatible addon API version found for " + coordinate
+ " for API " + runtimeAPIVersion);
}
addonId = selected;
}
}
else
{
throw new IllegalArgumentException("Unrecognized format: " + coordinates + ", format must match: GROUP_ID:ARTIFACT_ID:VERSION");
}
AddonActionRequest request = addonManager.install(addonId);
System.out.println(request);
if (!batchMode)
{
String result = System.console().readLine("Confirm installation [Y/n]? ");
if ("n".equalsIgnoreCase(result.trim()))
{
System.out.println("Installation aborted.");
return;
}
}
request.perform();
System.out.println("Installation completed successfully.");
System.out.println();
}
catch (Exception e)
{
e.printStackTrace();
System.out.println("> Forge version [" + runtimeAPIVersion + "]");
}
}