apache/maven · error · IllegalArgumentException

Specified file does not exists (${file})

Error message

Specified file does not exists (${file})

What it means

Error "Specified file does not exists (${file})" thrown in apache/maven.

Source

Thrown at impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvn/MavenParser.java:47

import org.apache.commons.cli.ParseException;
import org.apache.maven.api.cli.Options;
import org.apache.maven.api.cli.mvn.MavenOptions;
import org.apache.maven.cling.invoker.BaseParser;

public class MavenParser extends BaseParser {
    @Override
    protected Options parseCliOptions(LocalContext context) {
        ArrayList<MavenOptions> result = new ArrayList<>();
        // CLI args
        MavenOptions cliOptions = parseMavenCliOptions(context.parserRequest.args());
        result.add(cliOptions);
        // atFile option
        if (cliOptions.atFile().isPresent()) {
            Path file = context.cwd.resolve(cliOptions.atFile().orElseThrow());
            if (Files.isRegularFile(file)) {
                result.add(parseMavenAtFileOptions(file));
            } else {
                throw new IllegalArgumentException("Specified file does not exists (" + file + ")");
            }
        }
        // maven.config; if exists
        Path mavenConfig = context.rootDirectory != null ? context.rootDirectory.resolve(".mvn/maven.config") : null;
        if (mavenConfig != null && Files.isRegularFile(mavenConfig)) {
            result.add(parseMavenConfigOptions(mavenConfig));
        }
        return LayeredMavenOptions.layerMavenOptions(result);
    }

    protected MavenOptions parseMavenCliOptions(List<String> args) {
        try {
            return parseArgs(Options.SOURCE_CLI, args);
        } catch (ParseException e) {
            throw new IllegalArgumentException("Failed to parse CLI arguments: " + e.getMessage(), e.getCause());
        }
    }

View on GitHub (pinned to e4093d4e12)

When it happens

Trigger: Thrown at impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/mvn/MavenParser.java:47 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/5f135b1c17b72d7a. Report an issue: GitHub.