{"record":{"id":"7fb2145f0f65372d","repo":"elastic/elasticsearch","slug":"gradle-minimumgradleversion-is-required","errorCode":null,"errorMessage":"Gradle {minimumGradleVersion}+ is required","messagePattern":"Gradle (.+?)\\+ is required","errorType":"exception","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/info/GlobalBuildInfoPlugin.java","lineNumber":123,"sourceCode":"        this.providers = providers;\n        this.buildFeatures = buildFeatures;\n    }\n\n    @Override\n    public void apply(Project project) {\n        if (project != project.getRootProject()) {\n            throw new IllegalStateException(this.getClass().getName() + \" can only be applied to the root project.\");\n        }\n        this.project = project;\n        project.getPlugins().apply(JvmToolchainsPlugin.class);\n        project.getPlugins().apply(JdkDownloadPlugin.class);\n        project.getPlugins().apply(VersionPropertiesPlugin.class);\n        Provider<GitInfo> gitInfo = project.getPlugins().apply(GitInfoPlugin.class).getGitInfo();\n\n        toolChainService = project.getExtensions().getByType(JavaToolchainService.class);\n        GradleVersion minimumGradleVersion = GradleVersion.version(getResourceContents(\"/minimumGradleVersion\"));\n        if (GradleVersion.current().compareTo(minimumGradleVersion) < 0) {\n            throw new GradleException(\"Gradle \" + minimumGradleVersion.getVersion() + \"+ is required\");\n        }\n\n        Properties versionProperties = (Properties) project.getExtensions().getByName(VERSIONS_EXT);\n        JavaVersion minimumCompilerVersion = JavaVersion.toVersion(versionProperties.get(\"minimumCompilerJava\"));\n        JavaVersion minimumRuntimeVersion = JavaVersion.toVersion(versionProperties.get(\"minimumRuntimeJava\"));\n        Version elasticsearchVersionProperty = Version.fromString(versionProperties.getProperty(\"elasticsearch\"));\n\n        RuntimeJava runtimeJavaHome = findRuntimeJavaHome();\n        AtomicReference<BwcVersions> cache = new AtomicReference<>();\n        Provider<BwcVersions> bwcVersionsProvider = providers.provider(\n            () -> cache.updateAndGet(val -> val == null ? resolveBwcVersions(elasticsearchVersionProperty) : val)\n        );\n\n        BuildParameterExtension buildParams = project.getExtensions()\n            .create(\n                BuildParameterExtension.class,\n                BuildParameterExtension.EXTENSION_NAME,\n                DefaultBuildParameterExtension.class,","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/info/GlobalBuildInfoPlugin.java#L105-L141","documentation":"Thrown by GlobalBuildInfoPlugin.apply(Project) when the running Gradle version is older than the minimum required version. The minimum version is read from the classpath resource '/minimumGradleVersion' and compared via GradleVersion.current().compareTo(minimumGradleVersion) < 0. This ensures the build runs on a Gradle version compatible with all build logic.","triggerScenarios":"The developer or CI agent invokes the Gradle wrapper (or a system Gradle) whose version is below the value in the /minimumGradleVersion resource. For example, if minimumGradleVersion is '8.10' and the runner uses Gradle 8.5.","commonSituations":"A developer uses a system-installed Gradle (gradle build) instead of the wrapper (./gradlew build), and the system Gradle is outdated. The gradle-wrapper.properties was updated to a newer Gradle version but the developer's Gradle SDK in IntelliJ is still pointed at an old version. A CI image has an outdated Gradle that shadows the wrapper.","solutions":["Always use the Gradle wrapper: ./gradlew <task> instead of system gradle.","Update gradle/wrapper/gradle-wrapper.properties to match or exceed the minimum version if you intentionally changed the minimum.","In IntelliJ, go to Settings > Build Tools > Gradle and set 'Gradle wrapper' as the default, or update the Gradle SDK path.","Run gradle --version to check the current version if using a system Gradle."],"exampleFix":"# before (system gradle too old)\ngradle build  # Gradle 8.5\n\n# after (use wrapper)\n./gradlew build  # uses version from gradle-wrapper.properties","handlingStrategy":"validation","validationCode":"// Pre-build check: verify Gradle version\nGradleVersion minimum = GradleVersion.version(new String(\n    getClass().getResourceAsStream('/minimumGradleVersion').readAllBytes()).trim());\nif (GradleVersion.current().compareTo(minimum) < 0) {\n    throw new GradleException(\"Use ./gradlew wrapper or upgrade Gradle to \" + minimum);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always use ./gradlew instead of a system-installed Gradle.","Keep IntelliJ's Gradle SDK set to 'Use Gradle wrapper's default'.","Verify gradle-wrapper.properties distributionUrl matches the minimum version."],"tags":["gradle","version-compatibility","build-infrastructure","environment"],"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T08:17:17.861Z"}