{
DirectoryResource dependencyDir = getOrCreatePluginDependenciesModuleDirectory(dep);
String pluginName = dep.getGroupId() + "." + dep.getArtifactId();
String pluginSlot = dep.getVersion();
DependencyFacet deps = project.getFacet(DependencyFacet.class);
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.createChild("module").attribute("name", "javax.api");
dependencies.createChild("module").attribute("name", "org.jboss.forge.shell.api");
List<DependencyResource> pluginDependencies = new ArrayList<DependencyResource>();
List<Dependency> effectiveDependenciesInScopes = deps.getEffectiveDependenciesInScopes(ScopeType.COMPILE,
ScopeType.RUNTIME);
for (Dependency d : effectiveDependenciesInScopes) {
if (d.getPackagingTypeEnum().equals(PackagingType.JAR)
&& !d.getGroupId().equals("org.jboss.forge"))
{