apache/maven · error

The option -{} is deprecated

Error message

The option -{} is deprecated

What it means

Error "The option -{} is deprecated" thrown in apache/maven.

Source

Thrown at compat/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java:622

                    sb.append(",--").append(option.getLongOpt());
                }
                sb.append(" is deprecated ");
                if (option.getDeprecated().isForRemoval()) {
                    sb.append("and will be removed in a future version");
                }
                if (option.getDeprecated().getSince() != null) {
                    sb.append("since Maven ").append(option.getDeprecated().getSince());
                }
                boolean error = false;
                if (option.getDeprecated().getDescription() != null) {
                    sb.append(": ").append(option.getDeprecated().getDescription());
                    error = option.getDeprecated().getDescription().startsWith("UNSUPPORTED:");
                }
                if (error) {
                    slf4jLogger.error(sb.toString());
                    fail = true;
                } else {
                    slf4jLogger.warn(sb.toString());
                }
            }
        }
        if (fail) {
            throw new ExitException(1);
        }
    }

    private void version(CliRequest cliRequest) {
        if (cliRequest.verbose || cliRequest.commandLine.hasOption(CLIManager.SHOW_VERSION)) {
            System.out.println(CLIReportingUtils.showVersion());
        }
    }

    private void commands(CliRequest cliRequest) {
        if (cliRequest.showErrors) {
            slf4jLogger.info("Error stacktraces are turned on.");
        }

View on GitHub (pinned to e4093d4e12)

When it happens

Trigger: Thrown at compat/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java:622 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/6de265587e3fef17. Report an issue: GitHub.