Skip to content

Commit

Permalink
[WFCORE-7104] Use ModuleDependency.Builder instead of deprecated Modu…
Browse files Browse the repository at this point in the history
…leDependency ctor in Elytron
  • Loading branch information
ropalka committed Dec 18, 2024
1 parent ebf13df commit 2a4a3cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import org.jboss.as.server.deployment.module.ModuleDependency;
import org.jboss.as.server.deployment.module.ModuleSpecification;
import org.jboss.modules.Module;
import org.jboss.modules.ModuleIdentifier;
import org.jboss.modules.ModuleLoader;

/**
Expand All @@ -22,15 +21,15 @@
*/
class DependencyProcessor implements DeploymentUnitProcessor {

private final ModuleIdentifier elytronIdentifier = ModuleIdentifier.create("org.wildfly.security.elytron");
private final String elytronModuleName = "org.wildfly.security.elytron";

@Override
public void deploy(DeploymentPhaseContext context) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = context.getDeploymentUnit();
final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
final ModuleLoader moduleLoader = Module.getBootModuleLoader();

moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, elytronIdentifier, false, false, true, false));
moduleSpecification.addSystemDependency(ModuleDependency.Builder.of(moduleLoader, elytronModuleName).setImportServices(true).build());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public void deploy(DeploymentPhaseContext phaseContext) {
final ModuleLoader moduleLoader = Module.getBootModuleLoader();
final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);

moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, JACC_API, false, false, true, false));
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, AUTH_MESSAGE_API, false, false, true, false));
moduleSpecification.addSystemDependency(ModuleDependency.Builder.of(moduleLoader, JACC_API).setImportServices(true).build());
moduleSpecification.addSystemDependency(ModuleDependency.Builder.of(moduleLoader, AUTH_MESSAGE_API).setImportServices(true).build());
}

}

0 comments on commit 2a4a3cb

Please sign in to comment.