you should change code a bit, to something like this
final ModuleSpecification moduleSpec =
and you should run your DUP in Phase.DEPENDENCIES
On Tue, Feb 17, 2015 at 4:34 PM, Carl Harris <ceharris414(a)me.com> wrote:
I’ve written an extension in which I would like to make add a module
dependency to a deployment (as if the dependency had been included in the
Dependencies manifest header or jboss-deployment-structure.xml).
I’m assuming that this needs to happen in a DeploymentUnitProcessor.
Looking at how the ManifestDeploymentProcessor in wildfly-core works, it
seems I should be able to do something like this in a deployment processor
that runs in the PARSE phase:
ModuleIdentifier moduleId = ModuleIdentifier.create(“org.example.api”);
ModuleLoader loader = Module.getBootModuleLoader();
ModuleDependency dependency = new ModuleDependency(loader, moduleId,
false, false, false, false);
This isn’t working — the deployment unit processor runs without error, but
when I try to reference classes provided by the module, I get
Of course, If I add the same module identifier to the Dependencies
manifest header in the deployment itself, all is well.
Perhaps this isn’t the way to approach this problem?
Thanks in advance for any tips/guidance,
wildfly-dev mailing list