Skip to content

Commit eeab1bd

Browse files
committed
test(build): load Java plugin companion plugins in 262 test sandbox
On 262 the plugin-java tests failed with the Java plugin's services missing: JavaDirectoryService.getInstance() returned null, ProjectJdkTable could not be cast to JavaAwareProjectJdkTableImpl, and JarApplicationConfigurationType was not a registered run-config type. Root cause: the whole 'Java' plugin was excluded from the test sandbox because several bundled plugins it depends on (structure view, bookmarks, test runner, todo, structural search, misc libraries, copyright, terminal, XPath) were not present, and the Gradle plugin no longer resolves the transitive bundled-plugin dependencies of a bundledPlugin() automatically since 2.4.0 (JetBrains/intellij-platform-gradle-plugin#1930). Once a required content module cannot resolve, the entire Java plugin — including its impl/execution/backend modules that register those services — is dropped. There is no catch-all or "full IDE" test mode, so declare the companion plugins explicitly. Kept as a single documented list (javaTestCompanionPlugins) and guarded to platformVersion >= 262 so 251 is untouched. Verified: full :plugin-java:test passes on both 251 and 262. Assisted-by: Claude:claude-opus-4-8
1 parent ea64cf1 commit eeab1bd

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

build.gradle.kts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,24 @@ version = pluginVersionString
4545

4646
val platformVersion = prop("platformVersion").toInt()
4747

48+
// Bundled plugins that com.intellij.java requires but that the Gradle plugin no longer pulls in
49+
// transitively (JetBrains/intellij-platform-gradle-plugin#1930), so the Java plugin is excluded from
50+
// the 262+ test sandbox and its services (JavaDirectoryService, JavaAwareProjectJdkTable, run-config
51+
// types) never register. There is no catch-all/"full IDE" test mode, so we list them explicitly.
52+
// To refresh after a platform bump: run tests, look for "'Java' ... excluded" / "X is not resolved"
53+
// in the sandbox log, and add the plugin owning module X (`printBundledPlugins` lists the IDs).
54+
val javaTestCompanionPlugins = listOf(
55+
"intellij.structureView.plugin",
56+
"intellij.bookmarks.plugin",
57+
"intellij.testRunner.plugin",
58+
"intellij.todo.plugin",
59+
"intellij.structuralSearch.plugin",
60+
"intellij.libraries.misc.plugin",
61+
"com.intellij.copyright",
62+
"org.jetbrains.plugins.terminal",
63+
"XPathView",
64+
)
65+
4866
val isCI = System.getenv("CI") == "true"
4967
val agentOutputPath = rootProject.layout.buildDirectory.asFile.get()
5068
.resolve("appmap-java-agent")
@@ -479,6 +497,10 @@ project(":plugin-java") {
479497
intellijPlatform {
480498
bundledPlugin("com.intellij.java")
481499
bundledPlugin("com.intellij.properties")
500+
// see javaTestCompanionPlugins
501+
if (platformVersion >= 262) {
502+
bundledPlugins(javaTestCompanionPlugins)
503+
}
482504
}
483505
}
484506
}

0 commit comments

Comments
 (0)