private static void checkConfigurations(final String projectPath) throws Exception {
        var pass = new AtomicBoolean(true);
        var pattern = Pattern.compile("^.*@Qualifier\\(\"(.+)\"\\)$");
        Files.walk(Paths.get(projectPath))
            .filter(f -> Files.isRegularFile(f) && f.toFile().getName().endsWith("Configuration.java"))
            .forEach(file -> {
//                print("Examining file %s", file);
                var contents = readFile(file);
                var matcher = pattern.matcher(contents);
                while (matcher.find()) {
                    var match = ".*\\w+\\s+\\w+\\s+" + matcher.group(1) + "\\(.*";
                    var matcher2 = Pattern.compile(match).matcher(contents);
//                    print("\tLooking for match %s", match);
                    if (matcher2.find()) {
                        print("Found injected dependency in file %s: Dependency injection is declared as a @Bean method: %s",
                           file.toFile().getPath(), matcher2.group().trim());
                        pass.set(false);
                        break;
                    }
                }
            });
        if (!pass.get()) {
            System.exit(1);
        }
    }
This is {@link CheckSpringConfigurationFactories}.

@author Misagh Moayyed
@since 6.4.0
ci/checks/CheckMixingSpringBeanWithDependencyInjection.java