[build] Add java:local_dev rake task for IntelliJ IDEA project setup - #17771
[build] Add java:local_dev rake task for IntelliJ IDEA project setup#17771titusfortner wants to merge 15 commits into
Conversation
PR Summary by QodoAdd
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo
1.
|
|
Code review by qodo was updated up to the latest commit d9eeb3b |
There was a problem hiding this comment.
Pull request overview
Adds Java local-development tooling to the Selenium monorepo by introducing a java:local_dev rake task and IntelliJ IDEA project wiring so contributors can work in IDEA without relying on the Bazel plugin, using jars materialized into ./java-libs.
Changes:
- Add
java:local_devrake task to build and copy Bazel-derived dependency jars into./java-libs(with asources/subdir). - Wire IntelliJ to resolve a new project-level
java-libslibrary and add it to thejavamodule. - Ignore the generated
./java-libsdirectory in git.
Reviewed changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| rake_tasks/java.rake | Adds the java:local_dev task and the Starlark cquery expression used to collect dependency jars. |
| java/java.iml | Adds a module order entry referencing the new java-libs IDEA project library. |
| .idea/libraries/java-libs.xml | Defines the IDEA project library pointing at java-libs/ and java-libs/sources/. |
| .gitignore | Ignores the generated java-libs directory. |
Files not reviewed (1)
- .idea/libraries/java-libs.xml: Generated file
|
Code review by qodo was updated up to the latest commit d004a02 |
|
Code review by qodo was updated up to the latest commit 74c91e3 |
|
@titusfortner Thanks, it almost works! Few problems:
java: An exception has occurred in the compiler (17.0.14). Please file a bug against the Java compiler via the Java bug reporting page (https://bugreport.java.com) after checking the Bug Database (https://bugs.java.com) for duplicates. Include your program, the following diagnostic, and the parameters passed to the Java compiler in your report. Thank you.
java: java.lang.UnsupportedClassVersionError: com/google/errorprone/ErrorProneJavacPlugin has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0So we need to set Project SDK to JDK 21. |
…tests+tooling (JDK 17, SDK 25)
|
@asolntsev I went with the more complex solution so that we keep the IDE enforcement of Java 11, but I think that should work |
… from IntelliJ project
|
Code review by qodo was updated up to the latest commit a45d812 |
|
Code review by qodo was updated up to the latest commit fb1cf9c |
|
Code review by qodo was updated up to the latest commit c3a7c09 |
|
@titusfortner I tried to fresh-clone the branch - still getting an error in IDEA:
|
|
Code review by qodo was updated up to the latest commit 87ad213 |
|
@asolntsev |
|
@titusfortner Now it's failing with a new error :) |
Code Review by Qodo
1. Processed jars skipped
|
|
Code review by qodo was updated up to the latest commit 02f1b83 |
|
Code review by qodo was updated up to the latest commit f8931fa |
…ommons-exec is kept
|
Code review by qodo was updated up to the latest commit 8dddc3d |
|
@asolntsev ok, try now, thanks |
…e CDP jars into java-libs
|
Code review by qodo was updated up to the latest commit cdfeea4 |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 10 changed files in this pull request and generated 1 comment.
Files not reviewed (4)
- .idea/libraries/java-libs.xml: Generated file
- .idea/libraries/libcdp.xml: Generated file
- .idea/misc.xml: Generated file
- .idea/modules.xml: Generated file
…the maven variant skip explicit
|
Code review by qodo was updated up to the latest commit 77d01de |
|
@asolntsev ok I spent more time on rewriting this a bit so it doesn't start seeming like a hack on top of another. This seems to work locally in all the ways I tested it. |





🔗 Related Issues
Closes #17765
💥 What does this PR do?
Adds a
java:local_devrake task (alongsiderb:local_dev/py:local_dev) that copies the Bazel-built dependency jars the IntelliJ modules compile against into./java-libs, so the repo can be developed with standard Java tooling — running, debugging, profiling, running individual tests — without the Bazel plugin.It also updates the checked-in IntelliJ project so the repo opens and compiles cleanly out of the box: a
java-libsproject library, and a split of the Java module intojava(released code, Java 11) andjava-dev(tests +src/devtooling, Java 17), with the project SDK set to JDK 25. These files are read only by IntelliJ, so they don't affect Bazel-plugin users or other editors.🔧 Implementation Notes
java-libsis scoped to the modules' resolved compile+runtime classpath — via cquery overJavaInfo.transitive_runtime_jarsplus the in-treejava_binarytools'runtime_classpath— not the full pinned set. Unused transitives (e.g. javacc's test-only junit-4) are excluded by construction rather than by a name list.v<NN>-libcdp.jarand picked up by the library's directory scan, so version bumps need no maintenance. This replaces the hand-updated.idea/libraries/libcdp.xml(removed here), which had drifted to stale versions.external/tree, so there's no dependency on the IntelliJ Bazel plugin.java-libsdirectory, so it stays empty and inert until the task is run — an accidental check-in of the wiring can't break anyone's setup.src/dev(compiled at--release 17) live in a Java 17 module. The project SDK is JDK 25 to matchremotejdk_25(required by ErrorProne). Bazel stays the source of truth for the actual--releasetargets.🤖 AI assistance
💡 Additional Considerations
No automated test: this is a dev-tooling rake task that shells out to a live Bazel build, matching
rb:local_dev/py:local_dev(also untested). Verified by reproducing the IDE's symbol resolution — everyimportinjava/src+java/testresolves against the generatedjava-libs(0 unresolved).🔄 Types of changes