Package org.jboss.shrinkwrap.descriptor.spi

Examples of org.jboss.shrinkwrap.descriptor.spi.Node


      modifyConfiguration(new ModifyNode()
      {
         @Override
         public void modify(Node configuration)
         {
            Node excludes = configuration
                     .getOrCreate("artifactSet")
                     .getOrCreate("includes");

            for (Node n : excludes.get("include"))
            {
               if (DependencyBuilder.areEquivalent(DependencyBuilder.create(n.text()), dep))
               {
                  return;
               }
            }

            excludes.create("include").text(dep.getGroupId() + ":" + dep.getArtifactId());
         }
      });
   }
View Full Code Here


      modifyConfiguration(new ModifyNode()
      {
         @Override
         public void modify(Node configuration)
         {
            Node excludes = configuration
                     .getOrCreate("artifactSet")
                     .getOrCreate("excludes");

            for (Node n : excludes.get("exclude"))
            {
               if (DependencyBuilder.areEquivalent(DependencyBuilder.create(n.text()), dep))
               {
                  return;
               }
            }

            excludes.create("exclude").text(dep.getGroupId() + ":" + dep.getArtifactId());
         }
      });
   }
View Full Code Here

      modifyConfiguration(new ModifyNode()
      {
         @Override
         public void modify(Node configuration)
         {
            Node relocationNode = configuration.getOrCreate("relocations").create("relocation");
            relocationNode.create("pattern").text(pattern);
            relocationNode.create("shadedPattern").text(shadedPattern);

            String excludeMsg = "";
            if (excludes != null && excludes.length > 0)
            {
               Node excludesNode = relocationNode.create("excludes");
               for (String e : excludes)
               {
                  excludesNode.create("exclude").text(e);
               }
               excludeMsg = ", excluding " + Arrays.asList(excludes);
            }
            ShellMessages.success(shell, "Relocating [" + pattern + "] to [" + shadedPattern + "]" + excludeMsg);
         }
View Full Code Here

      modifyConfiguration(new ModifyNode()
      {
         @Override
         public void modify(Node configuration)
         {
            Node relocationNode = configuration
                     .getOrCreate("transformers")
                     .getOrCreate(
                              "transformer@implementation=org.apache.maven.plugins.shade.resource.ManifestResourceTransformer");
            relocationNode.getOrCreate("mainClass").text(mainClass);
         }
      });

   }
View Full Code Here

         MavenCoreFacet mvn = project.getFacet(MavenCoreFacet.class);
         Model pom = mvn.getPOM();

         org.apache.maven.model.Plugin plugin = getPlugin(pom);
         PluginExecution execution = plugin.getExecutions().get(0);
         Node configuration = XMLParser.parse(((Xpp3Dom) execution.getConfiguration()).toUnescapedString());

         command.modify(configuration);

         execution.setConfiguration(Xpp3DomBuilder.build(XMLParser.toXMLInputStream(configuration), "UTF-8"));
         mvn.setPOM(pom);
View Full Code Here

      List<Resource<?>> listResources = pluginDir.listResources();

      for (Resource<?> resource : listResources) {
         if ("module.xml".equals(resource.getName()))
         {
            Node module = XMLParser.parse(resource.getResourceInputStream());
            if (module != null)
            {
               String pluginName = module.attribute("name");
               String pluginSlot = module.attribute("slot");
               if (pluginSlot == null)
               {
                  pluginSlot = "";
               }
               else
View Full Code Here

      moduleXml.delete();
      moduleXml.createNewFile();

      // <resource-root path="maven-dependency.jar" />
      Node module = XMLParser.parse(getClass().getResourceAsStream("/org/jboss/forge/modules/module.xml"));
      module.attribute("name", pluginName);
      module.attribute("slot", pluginSlot);
      Node resources = module.getSingle("resources");

      resources.create("resource-root").attribute("path", dep.getArtifactId() + ".jar");

      // Copy the compiled JAR into the module directory
      FileResource<?> jar = moduleDir.getChild(dep.getArtifactId() + ".jar").reify(FileResource.class);
      jar.createNewFile();
      jar.setContents(artifact.getResourceInputStream());

      // <module name="org.jboss.forge:main" />
      Node dependencies = module.getSingle("dependencies");
      dependencies.create("module").attribute("name", pluginName + ".dependencies").attribute("slot", pluginSlot);
      dependencies.create("module").attribute("name", "org.jboss.forge.shell-api");
      dependencies.create("module").attribute("name", "javax.api");

      moduleXml.setContents(XMLParser.toXMLString(module));

      createDependenciesModule(project, dep);
View Full Code Here

      FileResource<?> moduleXml = (FileResource<?>) dependencyDir.getChild("module.xml");
      moduleXml.delete();
      moduleXml.createNewFile();

      // <resource-root path="maven-dependency.jar" />
      Node module = XMLParser.parse(getClass().getResourceAsStream("/org/jboss/forge/modules/module.xml"));
      module.attribute("name", pluginName + ".dependencies");
      module.attribute("slot", pluginSlot);
      Node resources = module.getSingle("resources");

      // <module name="org.jboss.forge:main" />
      Node dependencies = module.getSingle("dependencies");
      dependencies.create("module").attribute("name", "javax.api");

      List<DependencyResource> pluginDependencies = new ArrayList<DependencyResource>();
      List<Dependency> effectiveDependenciesInScopes = deps.getEffectiveDependenciesInScopes(ScopeType.COMPILE,
               ScopeType.RUNTIME);
      for (Dependency d : effectiveDependenciesInScopes) {
View Full Code Here

         moduleXml.delete(true);
         moduleXml.createNewFile();
         moduleXml.setContents(getClass().getResourceAsStream("/org/jboss/forge/modules/module.xml"));
      }

      Node module = XMLParser.parse(moduleXml.getResourceInputStream());

      Node plugin = module.attribute("name", "org.jboss.forge.plugins")
               .getSingle("dependencies")
               .getOrCreate("module@name=" + pluginName);

      plugin.attribute("slot", pluginSlot)
               .attribute("export", true).attribute("services", "export")
               .attribute("optional", "true");

      Node imports = plugin.getOrCreate("imports");
      imports.getOrCreate("include@path=**");
      imports.getOrCreate("include@path=META-INF");

      Node exports = plugin.getOrCreate("exports").getOrCreate("include-set");
      exports.getOrCreate("path@name=**");
      exports.getOrCreate("path@name=META-INF");

      moduleXml.setContents(XMLParser.toXMLString(module));
   }
View Full Code Here

   // Constructor ------------------------------------------------------------------------||
   //-------------------------------------------------------------------------------------||

   public ArquillianDescriptorImpl(String descirptorName)
   {
      this(descirptorName, new Node("arquillian")
         .attribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance")
         .attribute("xmlns", "http://jboss.org/schema/arquillian")
         .attribute("xsi:schemaLocation", "http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd"));
   }
View Full Code Here

TOP

Related Classes of org.jboss.shrinkwrap.descriptor.spi.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.