fix: resolve local Gradle build against IntelliJ IDEA 2026.2 - #996
fix: resolve local Gradle build against IntelliJ IDEA 2026.2#996catatafishen wants to merge 1 commit into
Conversation
Fixes #968. Local compiles against a `intellijPlatform.localPath` IDE install broke against IU 2026.2 (build 262) with ~108 unresolved references (JCEF, dvcs/vcs-log classes): - JCEF (`com.intellij.ui.jcef.*`, `org.cef.*`) moved out of the auto-included boot classpath into a separately class-loaded bundled plugin (`com.intellij.modules.jcef`) as of build 262. Declare it explicitly via `bundledPlugin`. - `com.intellij.dvcs.repo.Repository` / `AbstractRepositoryManager` (supertypes of `GitRepository`) and `com.intellij.vcs.log.impl.VcsProjectLog` live in product modules (`intellij.platform.vcs.dvcs`, `intellij.platform.vcs.dvcs.impl`, `intellij.platform.vcs.log.impl`) that IU 262 stopped auto-including on the compile classpath. Request them explicitly via `bundledModule` (a no-op on older versions where they were already auto-included). - `intellij.libraries.lucene.common.jar` no longer exists at all in IU 262's `lib/` — the unconditional `bundledLibrary(...)` call for it now only fires when the jar is present on disk. - A blank `intellijPlatform.localPath` (e.g. `-PintellijPlatform.localPath=` passed to opt out of a broken local IDE without editing `~/.gradle/gradle.properties`) is now treated as unset instead of being passed to `local()` as a literal empty path. Verified by compiling `plugin-core` and `plugin-experimental` against a local IU 2026.2.0.1 (262.8665.337) install — previously ~108 errors, now BUILD SUCCESSFUL. CI (which downloads 2026.1.3, unaffected by this bug) is unchanged by these edits since the added `bundledPlugin`/ `bundledModule` calls are no-ops there. Not addressed here (out of scope / separate problems): - Bumping the IntelliJ Platform Gradle Plugin: 2.18.1 is still the latest release: no newer version exists that changes this behavior. - Adding a 262 CI compatibility job: `integration-tests` fails to even resolve dependencies against a 2026.2 `local()` install due to an unrelated JVM-toolchain metadata mismatch (21 vs 25) introduced by 2026.2 requiring Java 25 — a distinct issue from the compile-classpath breakage this issue reports. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
Resolves local Gradle compilation failures against IntelliJ IDEA IU 2026.2 (build 262+) by making the IntelliJ Platform Gradle configuration explicitly opt into newly split platform components (JCEF + VCS product modules) and by hardening local-path handling around removed Lucene artifacts.
Changes:
- Treat
-PintellijPlatform.localPath=(blank) as “unset” so builds fall back to the downloaded IDE instead of attemptinglocal(""). - Add explicit IntelliJ bundled dependencies in
plugin-corefor 2026.2’s split-out JCEF plugin and VCS-related product modules. - Guard
bundledLibrary("lib/intellij.libraries.lucene.common.jar")so local 2026.2 installs (where the jar is removed) don’t break dependency resolution.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| plugin-core/build.gradle.kts | Adds explicit JCEF + VCS module dependencies for 2026.2 local builds, guards Lucene bundled library, and normalizes blank localPath. |
| plugin-experimental/build.gradle.kts | Normalizes blank localPath and guards Lucene bundled library lookup for local installs. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // A blank value (e.g. `-PintellijPlatform.localPath=` passed on the command line to opt | ||
| // out of a broken local IDE without editing ~/.gradle/gradle.properties) must be treated | ||
| // as unset, not as a literal empty path passed to local(). | ||
| val localPath = providers.gradleProperty("intellijPlatform.localPath").orNull?.takeIf { it.isNotBlank() } |
|



Fixes #968.
Problem
A local Gradle compile of
plugin-core(:plugin-core:compileKotlin) fails with ~108 unresolved-reference errors whenintellijPlatform.localPathpoints at an IU 2026.2 (build 262+) installation:com.intellij.ui.jcef.*/org.cef.*(JCEF) —JBCefBrowser,JBCefJSQuery,JBCefApp, etc.com.intellij.dvcs.repo.Repository/AbstractRepositoryManager(supertypes of Git4Idea'sGitRepository)com.intellij.vcs.log.impl.VcsProjectLogReproduced locally against an actual IU 2026.2.0.1 (262.8665.337) install.
Root cause
Build 262 (2026.2) reorganized the platform layout further:
com.intellij.modules.jcef).intellij.platform.vcs.dvcs,intellij.platform.vcs.dvcs.impl, andintellij.platform.vcs.log.implareproductModuleV2jars inlib/that IntelliJ Platform Gradle Plugin 2.18.1 no longer puts on the compile classpath automatically.lib/intellij.libraries.lucene.common.jar(added explicitly for the 2026.1 move) no longer exists at all in 2026.2 — the previously-unconditionalbundledLibrary(...)call for it would itself break every local 2026.2 build.Fix
In
plugin-core/build.gradle.ktsandplugin-experimental/build.gradle.kts:bundledPlugin("com.intellij.modules.jcef")andbundledModule("intellij.platform.vcs.dvcs")/...vcs.dvcs.impl/...vcs.log.implso these resolve on the compile classpath. These calls are no-ops on 2025.3/2026.1 where the classes were already auto-included.lucene.common.jarbundledLibrarycall to only fire when the jar exists on disk (mirrors the existing guard used for the test-onlycompileOnly(files(jar))a few lines below).intellijPlatform.localPath(e.g.-PintellijPlatform.localPath=) as unset rather than passing an empty string tolocal(), so it can be used to opt out of a broken local IDE per-invocation without editing~/.gradle/gradle.properties.Verification
./gradlew :plugin-core:compileKotlinagainst the local IU 2026.2.0.1 install: previously ~108 errors → nowBUILD SUCCESSFUL../gradlew :plugin-core:compileTestJava :plugin-core:compileTestKotlin :plugin-experimental:compileKotlin :plugin-experimental:compileTestJava :mcp-server:compileJava:BUILD SUCCESSFUL.git stash) that:integration-tests:compileTestJavafails against the same 2026.2 local install both before and after this change, due to an unrelated JVM-toolchain metadata mismatch (project declares Java 21, 2026.2 requires 25) — a distinct, pre-existing problem not touched by this PR.intellijPlatformVersion=2026.1.3(nolocalPath), and the addedbundledPlugin/bundledModulecalls are no-ops there since those classes were already auto-included.Out of scope (from the issue's suggested work list)
integration-testsnoted above; tracking that as follow-up work rather than bundling an unrelated fix into this PR.