{"record":{"id":"d849a2e529041269","repo":"apache/maven","slug":"expected-loggerfactory-to-be-of-type-but-fou","errorCode":null,"errorMessage":"Expected LoggerFactory to be of type '{}', but found '{}' instead. The --fail-on-severity flag will not take effect.","messagePattern":"Expected LoggerFactory to be of type '(.+?)', but found '(.+?)' instead\\. The --fail-on-severity flag will not take effect\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compat/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java","lineNumber":589,"sourceCode":"        slf4jLogger = slf4jLoggerFactory.getLogger(this.getClass().getName());\n\n        if (commandLine.hasOption(CLIManager.FAIL_ON_SEVERITY)) {\n            String logLevelThreshold = commandLine.getOptionValue(CLIManager.FAIL_ON_SEVERITY);\n\n            if (slf4jLoggerFactory instanceof LogLevelRecorder recorder) {\n                LogLevelRecorder.Level level =\n                        switch (logLevelThreshold.toLowerCase(Locale.ENGLISH)) {\n                            case \"warn\", \"warning\" -> LogLevelRecorder.Level.WARN;\n                            case \"error\" -> LogLevelRecorder.Level.ERROR;\n                            default ->\n                                throw new IllegalArgumentException(\n                                        logLevelThreshold\n                                                + \" is not a valid log severity threshold. Valid severities are WARN/WARNING and ERROR.\");\n                        };\n                recorder.setMaxLevelAllowed(level);\n                slf4jLogger.info(\"Enabled to break the build on log level {}.\", logLevelThreshold);\n            } else {\n                slf4jLogger.warn(\n                        \"Expected LoggerFactory to be of type '{}', but found '{}' instead. \"\n                                + \"The --fail-on-severity flag will not take effect.\",\n                        LogLevelRecorder.class.getName(),\n                        slf4jLoggerFactory.getClass().getName());\n            }\n        }\n\n        // check for presence of deprecated options and print warning\n        boolean fail = false;\n        for (Option option : cliRequest.commandLine.getOptions()) {\n            if (option.isDeprecated()) {\n                StringBuilder sb = new StringBuilder();\n                sb.append(\"The option -\").append(option.getOpt());\n                if (option.getLongOpt() != null) {\n                    sb.append(\",--\").append(option.getLongOpt());\n                }\n                sb.append(\" is deprecated \");\n                if (option.getDeprecated().isForRemoval()) {","sourceCodeStart":571,"sourceCodeEnd":607,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/compat/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java#L571-L607","documentation":"Error \"Expected LoggerFactory to be of type '{}', but found '{}' instead. The --fail-on-severity flag will not take effect.\" thrown in apache/maven.","triggerScenarios":"Thrown at compat/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java:589 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}