From e6cde3235bcffc79fe18ba25f3af7072bf734a73 Mon Sep 17 00:00:00 2001 From: Eduardo Martins Date: Thu, 16 May 2024 12:23:51 +0100 Subject: [PATCH] [CMTOOL-370] skip migration to elytron tasks if there are no legacy security resources --- .../task/security/MigrateLegacySecurityDomainsToElytron.java | 2 +- .../task/security/MigrateLegacySecurityRealmsToElytron.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/servers/wildfly26.0/src/main/java/org/jboss/migration/wfly/task/security/MigrateLegacySecurityDomainsToElytron.java b/servers/wildfly26.0/src/main/java/org/jboss/migration/wfly/task/security/MigrateLegacySecurityDomainsToElytron.java index 4b0c4e9fe..9a0d8dafc 100644 --- a/servers/wildfly26.0/src/main/java/org/jboss/migration/wfly/task/security/MigrateLegacySecurityDomainsToElytron.java +++ b/servers/wildfly26.0/src/main/java/org/jboss/migration/wfly/task/security/MigrateLegacySecurityDomainsToElytron.java @@ -73,7 +73,7 @@ protected UpdateSubsystems(final LegacySecurityConfigurations legacySecurityConf ServerMigrationTaskResult taskResult = ServerMigrationTaskResult.SKIPPED; final SubsystemResource subsystemResource = params.getResource(); final LegacySecurityConfiguration legacySecurityConfiguration = legacySecurityConfigurations.getSecurityConfigurations().get(subsystemResource.getServerConfiguration().getConfigurationPath().getPath().toString()); - if (legacySecurityConfiguration != null) { + if (legacySecurityConfiguration != null && legacySecurityConfiguration.requiresMigration()) { if (migrateSubsystemEJB3(legacySecurityConfiguration, subsystemResource, context)) { taskResult = ServerMigrationTaskResult.SUCCESS; } diff --git a/servers/wildfly26.0/src/main/java/org/jboss/migration/wfly/task/security/MigrateLegacySecurityRealmsToElytron.java b/servers/wildfly26.0/src/main/java/org/jboss/migration/wfly/task/security/MigrateLegacySecurityRealmsToElytron.java index fe45f34f2..6d32e744c 100644 --- a/servers/wildfly26.0/src/main/java/org/jboss/migration/wfly/task/security/MigrateLegacySecurityRealmsToElytron.java +++ b/servers/wildfly26.0/src/main/java/org/jboss/migration/wfly/task/security/MigrateLegacySecurityRealmsToElytron.java @@ -92,7 +92,7 @@ protected MigrateToElytron(final LegacySecurityConfigurations legacySecurityConf final ManageableResourceTaskRunnableBuilder runnableBuilder = params -> context -> { final SubsystemResource subsystemResource = params.getResource(); final LegacySecurityConfiguration legacySecurityConfiguration = legacySecurityConfigurations.getSecurityConfigurations().get(subsystemResource.getServerConfiguration().getConfigurationPath().getPath().toString()); - if (legacySecurityConfiguration == null) { + if (legacySecurityConfiguration == null || !legacySecurityConfiguration.requiresMigration()) { return ServerMigrationTaskResult.SKIPPED; } migrateSecurityRealms(legacySecurityConfiguration, subsystemResource, context);