{"record":{"id":"a182e5478f026589","repo":"elastic/elasticsearch","slug":"configuring-a-snapshot-bwc-distribution-distri","errorCode":null,"errorMessage":"Configuring a snapshot bwc distribution ('${distribution.getName()}') without a bundled JDK is not supported.","messagePattern":"Configuring a snapshot bwc distribution \\('(.+?)'\\) without a bundled JDK is not supported\\.","errorType":"validation","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionDownloadPlugin.java","lineNumber":91,"sourceCode":"     * BWC versions are resolved as project to projects under `:distribution:bwc`.\n     */\n    private void registerInternalDistributionResolutions(List<DistributionResolution> resolutions, Provider<BwcVersions> bwcVersions) {\n        resolutions.add(new DistributionResolution(\"local-build\", (project, distribution) -> {\n            if (isCurrentVersion(distribution) && distribution.isDetachedVersion() == false) {\n                // non-external project, so depend on local build\n                return new ProjectBasedDistributionDependency(\n                    config -> projectDependency(project.getDependencies(), distributionProjectPath(distribution), config)\n                );\n            }\n            return null;\n        }));\n\n        resolutions.add(new DistributionResolution(\"bwc\", (project, distribution) -> {\n            BwcVersions.UnreleasedVersionInfo unreleasedInfo = bwcVersions.get()\n                .unreleasedInfo(Version.fromString(distribution.getVersion()));\n            if (unreleasedInfo != null && distribution.isDetachedVersion() == false) {\n                if (distribution.getBundledJdk() == false) {\n                    throw new GradleException(\n                        \"Configuring a snapshot bwc distribution ('\"\n                            + distribution.getName()\n                            + \"') \"\n                            + \"without a bundled JDK is not supported.\"\n                    );\n                }\n                String projectConfig = getProjectConfig(distribution, unreleasedInfo);\n                return new ProjectBasedDistributionDependency(\n                    (config) -> projectDependency(project.getDependencies(), unreleasedInfo.gradleProjectPath(), projectConfig)\n                );\n            }\n            return null;\n        }));\n\n        // Distribution resolution for \"detached\" versions. This allows for building from source for any version, including the current\n        // version of existing released versions from a commit form the main branch. This is done by passing certain system properties, ex:\n        //\n        // -Dtests.bwc.refspec.main=deadbeef -Dtests.bwc.main.version=9.0.0","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionDownloadPlugin.java#L73-L109","documentation":"Thrown as GradleException in the 'bwc' DistributionResolution when an unreleased (snapshot) BWC distribution is configured without a bundled JDK. Snapshot BWC distributions are built from source as project dependencies, and the build system only supports building them with a bundled JDK (no-JDK distributions are a release-time packaging concern, not a source-build concern).","triggerScenarios":"In registerInternalDistributionResolutions (line 86), when bwcVersions.unreleasedInfo(version) returns non-null (this is a snapshot/unreleased version) and distribution.isDetachedVersion() is false, the code checks distribution.getBundledJdk(). If false, it throws — the combination (snapshot BWC + no bundled JDK) is unsupported.","commonSituations":"A distribution configuration or test harness requests an unreleased BWC version with bundledJdk=false (intending to test the no-JDK variant); a new BWC version was added but the bundled-JDK distribution wasn't the one wired up; misconfiguration of distribution.getBundledJdk() in the test fixture.","solutions":["Configure the BWC distribution with a bundled JDK: ensure distribution.getBundledJdk() returns true for snapshot BWC versions.","If testing the no-JDK variant is required, use a released (non-snapshot) version via DRA instead of building from source.","Review the distribution definition under :distribution:bwc:<version> to confirm it produces a bundled-JDK archive."],"exampleFix":"// before: snapshot BWC dist configured without bundled JDK → throws\ndistribution.setBundledJdk(false);\n\n// after: bundle the JDK for snapshot BWC builds\ndistribution.setBundledJdk(true);","handlingStrategy":"validation","validationCode":"if (unreleasedInfo != null && distribution.isDetachedVersion() == false && distribution.getBundledJdk() == false) {\n    throw new IllegalStateException(\"Snapshot BWC '\" + distribution.getName() + \"' requires bundled JDK; refusing to configure.\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set distribution.setBundledJdk(true) for snapshot/unreleased BWC distributions.","Use released versions via DRA when testing no-JDK variants.","Review distribution configuration fixtures for BWC tests."],"tags":["bwc","distribution","jdk","configuration","gradle"],"backgroundTag":null,"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}