{"record":{"id":"8b01012688255807","repo":"apache/maven","slug":"required-maven-version-is-not-met-by-current-ve","errorCode":null,"errorMessage":"Required Maven version {} is not met by current version {}","messagePattern":"Required Maven version (.+?) is not met by current version (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"impl/maven-core/src/main/java/org/apache/maven/plugin/internal/MavenPluginMavenPrerequisiteChecker.java","lineNumber":62,"sourceCode":"    public void accept(PluginDescriptor pluginDescriptor) {\n        String requiredMavenVersion = pluginDescriptor.getRequiredMavenVersion();\n\n        boolean isBlankVersion =\n                requiredMavenVersion == null || requiredMavenVersion.trim().isEmpty();\n\n        if (!isBlankVersion) {\n            boolean isRequirementMet = false;\n            try {\n                isRequirementMet = runtimeInformation.isMavenVersion(requiredMavenVersion);\n            } catch (IllegalArgumentException e) {\n                logger.warn(\n                        \"Could not verify plugin's Maven prerequisite as an invalid version is given in \"\n                                + requiredMavenVersion,\n                        e);\n                return;\n            }\n            if (!isRequirementMet) {\n                throw new IllegalStateException(\"Required Maven version \" + requiredMavenVersion\n                        + \" is not met by current version \" + runtimeInformation.getMavenVersion());\n            }\n        }\n    }\n}\n","sourceCodeStart":44,"sourceCodeEnd":68,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/plugin/internal/MavenPluginMavenPrerequisiteChecker.java#L44-L68","documentation":"When a plugin declares <prerequisites><maven>X</maven></prerequisites>, MavenPluginMavenPrerequisiteChecker compares it against the running Maven using runtimeInformation.isMavenVersion(X) (a version-range containment check). If the check returns false, Maven aborts plugin use with IllegalStateException naming both the required and current Maven versions. An invalid/unparseable prerequisite string only logs a warning and returns; only a well-formed but unmet requirement throws.","triggerScenarios":"Loading/executing a plugin whose POM has a maven prerequisite (version or range) that does not contain the running Maven version: e.g. plugin requires 3.6.3 while running 3.5.0, or requires [3.0,3.8) while running Maven 3.8.x/4.x which falls outside the range.","commonSituations":"CI images or developer machines pinned to an old Maven while build plugins move forward (e.g. maven-compiler-plugin 3.13+ requires Maven 3.6.3); prerequisite ranges with an upper bound that excludes the Maven actually in use; switching a project to Maven 4 while a plugin caps the range below it.","solutions":["Upgrade Maven to at least the required version (prefer the Maven Wrapper: .mvn/wrapper/maven-wrapper.properties distributionUrl).","Pin a version of the plugin that is compatible with the Maven you must keep running.","If you own the plugin, relax or widen the <prerequisites><maven> range so it contains the Maven versions you support."],"exampleFix":"# before: CI Maven too old for the plugin\nmvn org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile  # fails: requires Maven 3.6.3\n\n# after: pin wrapper distribution\n# .mvn/wrapper/maven-wrapper.properties\ndistributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip\n./mvnw org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile","handlingStrategy":"validation","validationCode":"org.apache.maven.artifact.versioning.DefaultArtifactVersion running =\n        new org.apache.maven.artifact.versioning.DefaultArtifactVersion(runtimeInformation.getMavenVersion());\norg.apache.maven.artifact.versioning.DefaultArtifactVersion required =\n        new org.apache.maven.artifact.versioning.DefaultArtifactVersion(\"3.6.3\");\nif (running.compareTo(required) < 0) {\n    // select an older plugin version or fail with an actionable message before the build starts\n}","typeGuard":null,"tryCatchPattern":"try {\n    return pluginManager.getPluginDescriptor(plugin, repos, session);\n} catch (IllegalStateException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"Required Maven version\")) {\n        // downgrade the pinned plugin version and retry once\n    }\n    throw e;\n}","preventionTips":["Pin the Maven Wrapper distributionUrl per project so everyone builds with the same Maven","Pin plugin versions in the POM instead of relying on latest","Enforce a minimum Maven version with the maven-enforcer-plugin requireMavenVersion rule - its message is clearer than the prerequisite failure"],"tags":["maven","version","prerequisites","plugin","compatibility"],"backgroundTag":"prerequisite-version-not-met","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}