apache/maven · error · IllegalArgumentException

${logLevelThreshold} is not a valid log severity threshold.

Error message

${logLevelThreshold} is not a valid log severity threshold. Valid severities are WARN/WARNING and ERROR.

What it means

Error "${logLevelThreshold} is not a valid log severity threshold. Valid severities are WARN/WARNING and ERROR." thrown in apache/maven.

Source

Thrown at impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java:453

        }
    }

    protected void activateLogging(C context) throws Exception {
        if (!SLF4JBridgeHandler.isInstalled()) {
            SLF4JBridgeHandler.removeHandlersForRootLogger();
            SLF4JBridgeHandler.install();
        }

        context.slf4jConfiguration.activate();
        if (context.options().failOnSeverity().isPresent()) {
            String logLevelThreshold = context.options().failOnSeverity().get();
            if (context.loggerFactory instanceof LogLevelRecorder recorder) {
                LogLevelRecorder.Level level =
                        switch (logLevelThreshold.toLowerCase(Locale.ENGLISH)) {
                            case "warn", "warning" -> LogLevelRecorder.Level.WARN;
                            case "error" -> LogLevelRecorder.Level.ERROR;
                            default ->
                                throw new IllegalArgumentException(
                                        logLevelThreshold
                                                + " is not a valid log severity threshold. Valid severities are WARN/WARNING and ERROR.");
                        };
                recorder.setMaxLevelAllowed(level);
                context.logger.info("Enabled to break the build on log level " + logLevelThreshold + ".");
            } else {
                context.logger.warn("Expected LoggerFactory to be of type '" + LogLevelRecorder.class.getName()
                        + "', but found '"
                        + context.loggerFactory.getClass().getName() + "' instead. "
                        + "The --fail-on-severity flag will not take effect.");
            }
        }

        // at this point logging is set up, reply so far accumulated logs, if any and swap logger with real one
        Logger logger =
                new Slf4jLogger(context.loggerFactory.getLogger(getClass().getName()));
        context.logger.drain().forEach(e -> logger.log(e.level(), e.message(), e.error()));
        context.logger = logger;

View on GitHub (pinned to e4093d4e12)

When it happens

Trigger: Thrown at impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/LookupInvoker.java:453 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21). Data as JSON: /api/errors/f4cd9d3abf86a73e. Report an issue: GitHub.