moduleXml.delete();
moduleXml.createNewFile();
// <resource-root path="maven-dependency.jar" />
Node module = XMLParser.parse(getClass().getResourceAsStream(MODULE_TEMPLATE_XML));
module.attribute("name", pluginName);
module.attribute("slot", pluginSlot);
Node resources = module.getSingle("resources");
resources.createChild("resource-root").attribute("path", dep.getArtifactId() + ".jar");
if (dependenciesAsResourceRoot)
{
writeResourceRoots(project, module, moduleDir, resources);
}
// 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");
if (!dependenciesAsResourceRoot)
{
dependencies.createChild("module").attribute("name", pluginName + ".dependencies")
.attribute("slot", pluginSlot);
}
dependencies.createChild("module").attribute("name", "org.jboss.forge.javaee.api")
.attribute("services", "import");
dependencies.createChild("module").attribute("name", "org.jboss.forge.maven.api")
.attribute("services", "import");
dependencies.createChild("module").attribute("name", "org.jboss.forge.scaffold.api")
.attribute("services", "import");
dependencies.createChild("module").attribute("name", "org.jboss.forge.scaffoldx.api")
.attribute("services", "import");
dependencies.createChild("module").attribute("name", "org.jboss.forge.shell.api")
.attribute("services", "import");
dependencies.createChild("module").attribute("name", "org.jboss.seam.render").attribute("services", "import");
dependencies.createChild("module").attribute("name", "javax.api");
moduleXml.setContents(XMLParser.toXMLString(module));
if (!dependenciesAsResourceRoot)
{