use of org.jboss.as.server.deployment.module.ModuleDependency in project wildfly by wildfly.
the class WeldDependencyProcessor method deploy.
/**
* Add dependencies for modules required for weld deployments, if managed weld configurations are attached to the deployment
*/
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
final ModuleLoader moduleLoader = Module.getBootModuleLoader();
addDependency(moduleSpecification, moduleLoader, JAVAX_ENTERPRISE_API);
addDependency(moduleSpecification, moduleLoader, JAVAX_INJECT_API);
if (!WeldDeploymentMarker.isPartOfWeldDeployment(deploymentUnit)) {
// Skip if there are no beans.xml files in the deployment
return;
}
addDependency(moduleSpecification, moduleLoader, JAVAX_PERSISTENCE_API_ID);
addDependency(moduleSpecification, moduleLoader, WELD_CORE_ID);
addDependency(moduleSpecification, moduleLoader, WELD_PROBE_ID, true);
addDependency(moduleSpecification, moduleLoader, WELD_API_ID);
addDependency(moduleSpecification, moduleLoader, WELD_SPI_ID);
ModuleDependency weldSubsystemDependency = new ModuleDependency(moduleLoader, JBOSS_AS_WELD_ID, false, false, false, false);
weldSubsystemDependency.addImportFilter(PathFilters.getMetaInfFilter(), true);
weldSubsystemDependency.addImportFilter(PathFilters.is("org/jboss/as/weld/injection"), true);
weldSubsystemDependency.addImportFilter(PathFilters.acceptAll(), false);
weldSubsystemDependency.addExportFilter(PathFilters.getMetaInfFilter(), true);
moduleSpecification.addSystemDependency(weldSubsystemDependency);
// Due to serialization of Jakarta Enterprise Beans
ModuleDependency weldEjbDependency = new ModuleDependency(moduleLoader, JBOSS_AS_WELD_EJB_ID, true, false, false, false);
weldEjbDependency.addImportFilter(PathFilters.is("org/jboss/as/weld/ejb"), true);
weldEjbDependency.addImportFilter(PathFilters.acceptAll(), false);
moduleSpecification.addSystemDependency(weldEjbDependency);
}
use of org.jboss.as.server.deployment.module.ModuleDependency in project wildfly by wildfly.
the class CompensationsDependenciesDeploymentProcessor method addCompensationsModuleDependency.
private void addCompensationsModuleDependency(final DeploymentUnit unit) {
final ModuleLoader moduleLoader = Module.getBootModuleLoader();
final ModuleSpecification moduleSpec = unit.getAttachment(Attachments.MODULE_SPECIFICATION);
moduleSpec.addSystemDependency(new ModuleDependency(moduleLoader, COMPENSATIONS_MODULE, false, false, true, false));
}
use of org.jboss.as.server.deployment.module.ModuleDependency in project wildfly by wildfly.
the class WSClassVerificationProcessorTestCase method testCxfModuleDependencyPresent.
@Test
public void testCxfModuleDependencyPresent() {
spec.addUserDependency(new ModuleDependency(null, "org.apache.cxf", false, false, false, false));
Assert.assertTrue(WSClassVerificationProcessor.hasCxfModuleDependency(unit));
}
use of org.jboss.as.server.deployment.module.ModuleDependency in project wildfly by wildfly.
the class WSClassVerificationProcessorTestCase method testSiblingExportedCxfModuleDependencyPresent.
@Test
public void testSiblingExportedCxfModuleDependencyPresent() {
setSubDeploymentsIsolated(false);
siblingSpec.addUserDependency(new ModuleDependency(null, "org.apache.cxf", false, true, false, false));
Assert.assertTrue(WSClassVerificationProcessor.hasCxfModuleDependency(unit));
}
use of org.jboss.as.server.deployment.module.ModuleDependency in project wildfly by wildfly.
the class WSClassVerificationProcessorTestCase method testSiblingCxfModuleDependencyPresentIsolatedDeploymentsTrue.
@Test
public void testSiblingCxfModuleDependencyPresentIsolatedDeploymentsTrue() {
setSubDeploymentsIsolated(true);
siblingSpec.addUserDependency(new ModuleDependency(null, "org.apache.cxf", false, true, false, false));
Assert.assertFalse(WSClassVerificationProcessor.hasCxfModuleDependency(unit));
}
Aggregations