當前位置: 首頁>>代碼示例>>Java>>正文


Java MavenAddonDependencyResolver類代碼示例

本文整理匯總了Java中org.jboss.forge.furnace.manager.maven.addon.MavenAddonDependencyResolver的典型用法代碼示例。如果您正苦於以下問題:Java MavenAddonDependencyResolver類的具體用法?Java MavenAddonDependencyResolver怎麽用?Java MavenAddonDependencyResolver使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MavenAddonDependencyResolver類屬於org.jboss.forge.furnace.manager.maven.addon包,在下文中一共展示了MavenAddonDependencyResolver類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setUp

import org.jboss.forge.furnace.manager.maven.addon.MavenAddonDependencyResolver; //導入依賴的package包/類
@Before
public void setUp() throws IOException, InterruptedException
{
   furnace = ServiceLoader.load(Furnace.class).iterator().next();
   resolver = new MavenAddonDependencyResolver();
   repository = File.createTempFile("furnace-repo", ".tmp");
   repository.delete();
   repository.mkdir();
   furnace.addRepository(AddonRepositoryMode.MUTABLE, repository);
   furnace.startAsync();
   while (!furnace.getStatus().isStarted())
   {
      Thread.sleep(100);
   }
   addonManager = new AddonManagerImpl(furnace, resolver);
}
 
開發者ID:forge,項目名稱:furnace,代碼行數:17,代碼來源:AddonManagerHotswapTest.java

示例2: testFurnaceLoadsInstalledAddonFromSeparateInstance

import org.jboss.forge.furnace.manager.maven.addon.MavenAddonDependencyResolver; //導入依賴的package包/類
@Test(timeout = 20000)
public void testFurnaceLoadsInstalledAddonFromSeparateInstance() throws IOException, TimeoutException
{
   Assert.assertEquals(1, furnace.getRepositories().size());
   Assert.assertEquals(0, furnace.getAddonRegistry().getAddons().size());
   Assert.assertEquals(0, furnace.getRepositories().get(0).listEnabled().size());

   Furnace furnace2 = ServiceLoader.load(Furnace.class).iterator().next();
   AddonDependencyResolver resolver = new MavenAddonDependencyResolver();
   furnace2.addRepository(AddonRepositoryMode.MUTABLE, repository);
   AddonManager addonManager = new AddonManagerImpl(furnace2, resolver);

   AddonId addon = AddonId.from("test:no_dep", "1.1.2-SNAPSHOT");
   InstallRequest install = addonManager.install(addon);
   List<? extends AddonActionRequest> actions = install.getActions();
   Assert.assertEquals(1, actions.size());
   Assert.assertThat(actions.get(0), instanceOf(DeployRequest.class));
   install.perform();

   Addons.waitUntilStarted(furnace.getAddonRegistry().getAddon(addon));

   Assert.assertEquals(1, furnace2.getRepositories().get(0).listEnabled().size());
   Assert.assertEquals(1, furnace.getRepositories().get(0).listEnabled().size());
   Assert.assertEquals(1, furnace.getAddonRegistry().getAddons().size());
}
 
開發者ID:forge,項目名稱:furnace,代碼行數:26,代碼來源:AddonManagerHotswapTest.java

示例3: execute

import org.jboss.forge.furnace.manager.maven.addon.MavenAddonDependencyResolver; //導入依賴的package包/類
@Override
public void execute() throws MojoExecutionException, MojoFailureException
{
   if (skip)
   {
      getLog().info("Execution skipped.");
      return;
   }
   if (!addonRepository.exists())
   {
      throw new MojoExecutionException("Addon Repository " + addonRepository.getAbsolutePath() + " does not exist.");
   }
   Furnace forge = new FurnaceImpl();
   AddonRepository repository = forge.addRepository(AddonRepositoryMode.MUTABLE, addonRepository);
   MavenAddonDependencyResolver addonResolver = new MavenAddonDependencyResolver(this.classifier);
   addonResolver.setSettings(settings);
   AddonManager addonManager = new AddonManagerImpl(forge, addonResolver);
   for (String addonId : addonIds)
   {
      AddonId id = AddonId.fromCoordinates(addonId);
      RemoveRequest request = addonManager.remove(id, repository);
      getLog().info("" + request);
      request.perform();
   }
}
 
開發者ID:forge,項目名稱:furnace,代碼行數:26,代碼來源:AddonRemoveMojo.java

示例4: execute

import org.jboss.forge.furnace.manager.maven.addon.MavenAddonDependencyResolver; //導入依賴的package包/類
@Override
public void execute() throws MojoExecutionException, MojoFailureException
{
   Furnace forge = new FurnaceImpl();
   if (!addonRepository.exists())
   {
      addonRepository.mkdirs();
   }
   AddonRepository repository = forge.addRepository(AddonRepositoryMode.MUTABLE, addonRepository);
   MavenAddonDependencyResolver addonResolver = new MavenAddonDependencyResolver(this.classifier);
   addonResolver.setSettings(settings);
   AddonManager addonManager = new AddonManagerImpl(forge, addonResolver);

   for (String addonId : addonIds)
   {
      AddonId id = AddonId.fromCoordinates(addonId);
      InstallRequest install = addonManager.install(id, repository);
      if (!install.getActions().isEmpty())
      {
         getLog().info("" + install);
         install.perform();
      }
   }
}
 
開發者ID:koentsje,項目名稱:forge-furnace,代碼行數:25,代碼來源:AddonInstallMojo.java

示例5: testAddonsLoadAPIClassesFromBootpathJAR

import org.jboss.forge.furnace.manager.maven.addon.MavenAddonDependencyResolver; //導入依賴的package包/類
@Test
public void testAddonsLoadAPIClassesFromBootpathJAR() throws IOException, Exception
{
   Furnace furnace = FurnaceFactory.getInstance();

   furnace.addRepository(AddonRepositoryMode.MUTABLE, repodir1);

   AddonDependencyResolver resolver = new MavenAddonDependencyResolver();
   AddonManager manager = new AddonManagerImpl(furnace, resolver);

   AddonId no_dep = AddonId.from("test:no_dep", "1.0.0.Final");
   AddonId one_dep = AddonId.from("test:one_dep", "1.0.0.Final");

   manager.install(no_dep).perform();
   manager.install(one_dep).perform();

   ConfigurationScanListener listener = new ConfigurationScanListener();
   ListenerRegistration<ContainerLifecycleListener> registration = furnace.addContainerLifecycleListener(listener);

   furnace.startAsync();

   while (!listener.isConfigurationScanned())
      Thread.sleep(100);

   registration.removeListener();

   Addon projectsAddon = furnace.getAddonRegistry().getAddon(no_dep);
   Addons.waitUntilStarted(projectsAddon, 10, TimeUnit.SECONDS);

   ClassLoader addonClassLoader = projectsAddon.getClassLoader().loadClass(Addon.class.getName()).getClassLoader();
   ClassLoader appClassLoader = Addon.class.getClassLoader();
   Assert.assertNotEquals(appClassLoader, addonClassLoader);

   Assert.assertTrue(projectsAddon.getStatus().isStarted());
   furnace.stop();
}
 
開發者ID:forge,項目名稱:furnace,代碼行數:37,代碼來源:FurnaceSETest.java

示例6: setUp

import org.jboss.forge.furnace.manager.maven.addon.MavenAddonDependencyResolver; //導入依賴的package包/類
@Before
public void setUp() throws IOException
{
   furnace = ServiceLoader.load(Furnace.class).iterator().next();
   resolver = new MavenAddonDependencyResolver();
   repository = OperatingSystemUtils.createTempDir();
   furnace.addRepository(AddonRepositoryMode.MUTABLE, repository);
   addonManager = new AddonManagerImpl(furnace, resolver);
}
 
開發者ID:forge,項目名稱:furnace,代碼行數:10,代碼來源:AddonManagerRealTest.java

示例7: setUp

import org.jboss.forge.furnace.manager.maven.addon.MavenAddonDependencyResolver; //導入依賴的package包/類
@Before
public void setUp() throws IOException
{
   furnace = new FurnaceImpl();
   mutable = registerTempRepository(furnace, AddonRepositoryMode.MUTABLE);
   immutable = registerTempRepository(furnace, AddonRepositoryMode.IMMUTABLE);
   addonManager = new AddonManagerImpl(furnace, new MavenAddonDependencyResolver());
}
 
開發者ID:forge,項目名稱:furnace,代碼行數:9,代碼來源:AddonManagerRepositoryTest.java

示例8: deployAddonInImmutableRepository

import org.jboss.forge.furnace.manager.maven.addon.MavenAddonDependencyResolver; //導入依賴的package包/類
/**
 * Hack to deploy addon in an immutable repository
 */
private static void deployAddonInImmutableRepository(AddonId addonId, AddonRepository repository)
{
   Furnace furnace = new FurnaceImpl();
   furnace.addRepository(AddonRepositoryMode.MUTABLE, repository.getRootDirectory());
   AddonManagerImpl addonManager = new AddonManagerImpl(furnace, new MavenAddonDependencyResolver());
   addonManager.deploy(addonId).perform();
}
 
開發者ID:forge,項目名稱:furnace,代碼行數:11,代碼來源:AddonManagerRepositoryTest.java

示例9: isAddon

import org.jboss.forge.furnace.manager.maven.addon.MavenAddonDependencyResolver; //導入依賴的package包/類
/**
 * Returns <code>true</code> if this model is a single-project addon
 */
public boolean isAddon(Model model)
{
   boolean result = false;
   Build build = model.getBuild();
   if (build != null)
   {
      PLUGIN_LOOP: for (Plugin plugin : build.getPlugins())
      {
         if ("maven-jar-plugin".equals(plugin.getArtifactId()))
         {
            for (PluginExecution execution : plugin.getExecutions())
            {
               Xpp3Dom config = (Xpp3Dom) execution.getConfiguration();
               if (config != null)
               {
                  Xpp3Dom classifierNode = config.getChild("classifier");
                  if (classifierNode != null
                           && MavenAddonDependencyResolver.FORGE_ADDON_CLASSIFIER.equals(classifierNode.getValue()))
                  {
                     result = true;
                     break PLUGIN_LOOP;
                  }
               }
            }
         }
      }
   }
   return result;
}
 
開發者ID:forge,項目名稱:furnace,代碼行數:33,代碼來源:ProjectHelper.java

示例10: setUp

import org.jboss.forge.furnace.manager.maven.addon.MavenAddonDependencyResolver; //導入依賴的package包/類
@Before
public void setUp() throws IOException
{
   furnace = ServiceLoader.load(Furnace.class).iterator().next();
   resolver = new MavenAddonDependencyResolver();
   repository = File.createTempFile("furnace-repo", ".tmp");
   repository.delete();
   repository.mkdir();
   furnace.addRepository(AddonRepositoryMode.MUTABLE, repository);
   System.out.println(repository);
   addonManager = new AddonManagerImpl(furnace, resolver);
}
 
開發者ID:koentsje,項目名稱:forge-furnace,代碼行數:13,代碼來源:AddonManagerRealTest.java

示例11: setUp

import org.jboss.forge.furnace.manager.maven.addon.MavenAddonDependencyResolver; //導入依賴的package包/類
@Before
public void setUp() throws IOException
{
   furnace = ServiceLoader.load(Furnace.class).iterator().next();
   resolver = new MavenAddonDependencyResolver();
   repository = File.createTempFile("furnace-repo", ".tmp");
   repository.delete();
   repository.mkdir();
   furnace.addRepository(AddonRepositoryMode.MUTABLE, repository);
   addonManager = new AddonManagerImpl(furnace, resolver);
}
 
開發者ID:koentsje,項目名稱:forge-furnace,代碼行數:12,代碼來源:AddonManagerInstallTest.java

示例12: setUp

import org.jboss.forge.furnace.manager.maven.addon.MavenAddonDependencyResolver; //導入依賴的package包/類
@Before
public void setUp() throws IOException
{
   resolver = new MavenAddonDependencyResolver();
}
 
開發者ID:forge,項目名稱:furnace,代碼行數:6,代碼來源:AddonDependencyResolverTest.java

示例13: execute

import org.jboss.forge.furnace.manager.maven.addon.MavenAddonDependencyResolver; //導入依賴的package包/類
@Override
public void execute() throws MojoExecutionException, MojoFailureException
{
   if (skip)
   {
      getLog().info("Execution skipped.");
      return;
   }
   Furnace forge = new FurnaceImpl();
   if (!addonRepository.exists())
   {
      addonRepository.mkdirs();
   }
   else if (overwrite)
   {
      try
      {
         deleteDirectory(addonRepository);
         addonRepository.mkdirs();
      }
      catch (IOException e)
      {
         forge.close();
         throw new MojoExecutionException("Could not delete " + addonRepository, e);
      }
   }
   AddonRepository repository = forge.addRepository(AddonRepositoryMode.MUTABLE, addonRepository);
   MavenAddonDependencyResolver addonResolver = new MavenAddonDependencyResolver(this.classifier);
   addonResolver.setSettings(settings);
   addonResolver.setResolveAddonAPIVersions(!skipAddonAPIVersionResolution);
   AddonManager addonManager = new AddonManagerImpl(forge, addonResolver);

   for (String addonId : addonIds)
   {
      AddonId id = AddonId.fromCoordinates(addonId);
      InstallRequest install = addonManager.install(id, repository);
      if (!install.getActions().isEmpty())
      {
         getLog().info("" + install);
         install.perform();
      }
   }
}
 
開發者ID:forge,項目名稱:furnace,代碼行數:44,代碼來源:AddonInstallMojo.java

示例14: FurnaceContainerConfiguration

import org.jboss.forge.furnace.manager.maven.addon.MavenAddonDependencyResolver; //導入依賴的package包/類
public FurnaceContainerConfiguration()
{
   this.classifier = MavenAddonDependencyResolver.FORGE_ADDON_CLASSIFIER;
}
 
開發者ID:forge,項目名稱:furnace,代碼行數:5,代碼來源:FurnaceContainerConfiguration.java

示例15: testAddonsDuplicatedIfSubgraphDiffers

import org.jboss.forge.furnace.manager.maven.addon.MavenAddonDependencyResolver; //導入依賴的package包/類
@Test
public void testAddonsDuplicatedIfSubgraphDiffers() throws IOException, InterruptedException, TimeoutException
{
   Furnace furnace = FurnaceFactory.getInstance();
   AddonRepository left = furnace.addRepository(AddonRepositoryMode.MUTABLE, leftRepo);
   AddonRepository right = furnace.addRepository(AddonRepositoryMode.MUTABLE, rightRepo);
   AddonDependencyResolver resolver = new MavenAddonDependencyResolver();
   AddonManager manager = new AddonManagerImpl(furnace, resolver);

   AddonId no_dep = AddonId.from("test:no_dep", "1.0.0.Final");
   AddonId one_dep = AddonId.from("test:one_dep", "1.0.0.Final");
   AddonId one_dep_a = AddonId.from("test:one_dep_a", "1.0.0.Final");
   AddonId one_dep_lib = AddonId.from("test:one_dep_lib", "1.0.0.Final");

   AddonId one_dep_2 = AddonId.from("test:one_dep", "2.0.0.Final");

   Assert.assertFalse(left.isDeployed(one_dep_lib));
   Assert.assertFalse(left.isDeployed(one_dep_a));
   Assert.assertFalse(left.isDeployed(no_dep));
   Assert.assertFalse(left.isDeployed(one_dep));
   Assert.assertFalse(left.isDeployed(one_dep_2));
   Assert.assertFalse(right.isDeployed(one_dep_lib));
   Assert.assertFalse(right.isDeployed(one_dep_a));
   Assert.assertFalse(right.isDeployed(no_dep));
   Assert.assertFalse(right.isDeployed(one_dep));
   Assert.assertFalse(right.isDeployed(one_dep_2));

   manager.install(no_dep, left).perform();
   manager.deploy(one_dep, left).perform();
   manager.deploy(one_dep_a, left).perform();
   manager.deploy(one_dep_lib, left).perform();

   manager.deploy(one_dep_2, right).perform();

   Assert.assertTrue(left.isDeployed(no_dep));
   Assert.assertTrue(left.isDeployed(one_dep));
   Assert.assertTrue(left.isDeployed(one_dep_a));
   Assert.assertTrue(left.isDeployed(one_dep_lib));
   Assert.assertFalse(left.isDeployed(one_dep_2));

   Assert.assertFalse(right.isDeployed(no_dep));
   Assert.assertFalse(right.isDeployed(one_dep));
   Assert.assertFalse(right.isDeployed(one_dep_a));
   Assert.assertFalse(right.isDeployed(one_dep_lib));
   Assert.assertTrue(right.isDeployed(one_dep_2));

   ConfigurationScanListener listener = new ConfigurationScanListener();
   ListenerRegistration<ContainerLifecycleListener> registration = furnace.addContainerLifecycleListener(listener);

   furnace.startAsync();

   while (!listener.isConfigurationScanned())
      Thread.sleep(100);

   AddonRegistry registry = furnace.getAddonRegistry();
   Addons.waitUntilStarted(registry.getAddon(one_dep_a), 10, TimeUnit.SECONDS);
   AddonRegistry leftRegistry = furnace.getAddonRegistry(left);

   Addon addon = leftRegistry.getAddon(one_dep);
   Assert.assertNotNull(addon);

   registration.removeListener();

   furnace.stop();
}
 
開發者ID:forge,項目名稱:furnace,代碼行數:66,代碼來源:MultipleRepositoryViewTest.java


注:本文中的org.jboss.forge.furnace.manager.maven.addon.MavenAddonDependencyResolver類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。