Buggy code:
public class ModuleDeploymentProcessor implements DeploymentUnitProcessor { public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { final DeploymentModuleLoader deploymentModuleLoader = phaseContext . getDeploymentUnit ( ) . getAttachment ( DEPLOYMENT_MODULE_LOADER ) ; if ( deploymentModuleLoader == null ) { return ; } <START_BUG> final ResourceRoot mainRoot = phaseContext . getAttachment ( DEPLOYMENT_ROOT ) ; <END_BUG> if ( mainRoot == null ) { return ; } final DeploymentUnit deploymentUnit = phaseContext . getDeploymentUnit ( ) ; final List < ResourceRoot > additionalRoots = phaseContext . getAttachment ( RESOURCE_ROOTS ) ; final List < ModuleDependency > dependencies = phaseContext . getAttachment ( MODULE_DEPENDENCIES ) ; final ModuleIdentifier moduleIdentifier = ModuleIdentifier . create ( ( "deployment." + ( deploymentUnit . getName ( ) ) ) ) ; final ModuleSpec . Builder specBuilder = ModuleSpec . build ( moduleIdentifier ) ; ModuleDeploymentProcessor . addResourceRoot ( specBuilder , mainRoot ) ; for ( ResourceRoot additionalRoot : additionalRoots ) { ModuleDeploymentProcessor . addResourceRoot ( specBuilder , additionalRoot ) ; } final boolean childFirst = false ; if ( childFirst ) { specBuilder . addDependency ( DependencySpec . createLocalDependencySpec ( ) ) ; } for ( ModuleDependency dependency : dependencies ) { final List < FilterSpecification > importFilters = dependency . getImportFilters ( ) ; final List < FilterSpecification > exportFilters = dependency . getExportFilters ( ) ; final PathFilter importFilter ; final PathFilter exportFilter ; final MultiplePathFilterBuilder importBuilder = PathFilters . multiplePathFilterBuilder ( true ) ; for ( FilterSpecification filter : importFilters ) { importBuilder . addFilter ( filter . getPathFilter ( ) , filter . isInclude ( ) ) ; } if ( dependency . isImportServices ( ) ) { importBuilder . addFilter ( PathFilters . getMetaInfServicesFilter ( ) , true ) ; } importBuilder . addFilter ( PathFilters . getMetaInfSubdirectoriesFilter ( ) , false ) ; importBuilder . addFilter ( PathFilters . getMetaInfFilter ( ) , false ) ; importFilter = importBuilder . create ( ) ; if ( exportFilters . isEmpty ( ) ) { exportFilter = PathFilters . acceptAll ( ) ; } else { final MultiplePathFilterBuilder exportBuilder = PathFilters . multiplePathFilterBuilder ( dependency . isExport ( ) ) ; for ( FilterSpecification filter : exportFilters ) { exportBuilder . addFilter ( filter . getPathFilter ( ) , filter . isInclude ( ) ) ; } exportFilter = exportBuilder . create ( ) ; } DependencySpec depSpec = DependencySpec . createModuleDependencySpec ( importFilter , exportFilter , dependency . getModuleLoader ( ) , dependency . getIdentifier ( ) , dependency . isOptional ( ) ) ; specBuilder . addDependency ( depSpec ) ; } if ( ! childFirst ) { specBuilder . addDependency ( DependencySpec . createLocalDependencySpec ( ) ) ; } final ModuleSpec moduleSpec = specBuilder . create ( ) ; deploymentModuleLoader . addModuleSpec ( moduleSpec ) ; try { final Module module = deploymentModuleLoader . loadModule ( moduleIdentifier ) ; phaseContext . getDeploymentUnit ( ) . putAttachment ( MODULE , module ) ; } catch ( ModuleLoadException e ) { throw new DeploymentUnitProcessingException ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>module:<seq2seq4repair_space>" + moduleIdentifier ) , e ) ; } } private static void addResourceRoot ( final ModuleSpec . Builder specBuilder , final ResourceRoot resource ) throws DeploymentUnitProcessingException { } public void undeploy ( DeploymentUnit context ) { } }

Fix:
final ResourceRoot mainRoot = phaseContext . getDeploymentUnit ( ) . getAttachment ( DEPLOYMENT_ROOT ) ;