code: public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
          final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
  
          final ExtensionInfo extensionInfo = deploymentUnit.getAttachment(Attachments.EXTENSION_INFORMATION);
          if (extensionInfo == null) {
              return;
          }
          final ServiceController<?> extensionIndexController = phaseContext.getServiceRegistry().getRequiredService(
                  Services.JBOSS_DEPLOYMENT_EXTENSION_INDEX);
          final ExtensionIndex extensionIndexService = (ExtensionIndex) extensionIndexController.getValue();
          final ModuleIdentifier moduleIdentifier = deploymentUnit.getAttachment(Attachments.MODULE_IDENTIFIER);
          extensionIndexService.addDeployedExtension(moduleIdentifier, extensionInfo);
      }
docs: {@inheritDoc}