本文整理匯總了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 + "]");
}
}