Skip to content

Commit 6133b3f

Browse files
authored
fix: sync javaExtensions to the actual JUnit jar versions in server/ (#1869)
* fix: sync javaExtensions to the actual JUnit jar versions in server/ scripts/buildJdtlsExt.js rebuilds contributes.javaExtensions from the files that the Maven build dropped into server/, but main was last committed before a 5.14.3 -> 5.14.4 / 1.14.3 -> 1.14.4 bump landed in the java-extension POMs. As a result, the published extension declares six jars that the build no longer produces: junit-jupiter-api_5.14.3.jar (actual: 5.14.4) junit-jupiter-engine_5.14.3.jar (actual: 5.14.4) junit-jupiter-params_5.14.3.jar (actual: 5.14.4) junit-platform-commons_1.14.3.jar (actual: 1.14.4) junit-platform-engine_1.14.3.jar (actual: 1.14.4) junit-platform-launcher_1.14.3.jar (actual: 1.14.4) At runtime the JDT-LS bundle loader fails on each missing file with: Cannot extract bundle symbolicName or version .../server/junit-jupiter-api_5.14.3.jar java.nio.file.NoSuchFileException: ... leaving the test plugin partially or fully unloaded depending on what else fails first. The user-visible symptom is "Enable Java Tests" doing nothing on a clean install, no test discovery, and JDT-LS surfacing "N uncaught errors" in the status bar. This commit just brings the javaExtensions entries in line with what server/ actually contains today. Re-running `npm run build-plugin` produces the same diff, so there is no risk of further drift from this change. A follow-up should consider failing the build (or at least emitting a warning) when scripts/buildJdtlsExt.js detects a mismatch between the regenerated list and the committed one, so this kind of drift can't slip into another release unnoticed. * ci: fail CI when buildJdtlsExt.js would rewrite package.json The Build OSGi bundle step runs scripts/buildJdtlsExt.js, which unconditionally regenerates contributes.javaExtensions from the jars the Maven build actually drops into server/. If the committed array is stale (e.g. someone bumped a Maven dependency in java-extension/ without re-running the build), the regenerated array silently goes out of sync and the published extension declares jar paths that no longer exist on disk - exactly the failure mode this PR is fixing. Add a one-line guard after build-plugin on each OS job: git diff --exit-code --ignore-cr-at-eol -- package.json When the script rewrites the file, git reports a non-zero diff and the job fails with the exact list of stale entries, so the fix is just "copy the diff into the commit, push again". --ignore-cr-at-eol keeps Windows runners from tripping on LF/CRLF round-trips that don't change the underlying list.
1 parent 04d1702 commit 6133b3f

2 files changed

Lines changed: 21 additions & 6 deletions

File tree

.github/workflows/build.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ jobs:
4141
- name: Build OSGi bundle
4242
run: npm run build-plugin
4343

44+
# buildJdtlsExt.js regenerates contributes.javaExtensions from server/.
45+
# If the committed list is stale (e.g. someone bumped a Maven dep in
46+
# java-extension/ without re-running the build), the regenerated file
47+
# will differ. Fail the build with the diff so the drift can't slip
48+
# into a release unnoticed (cf. the 5.14.3/1.14.3 -> 5.14.4/1.14.4
49+
# mismatch this script was added to guard against).
50+
- name: Verify javaExtensions is in sync with server/
51+
run: git diff --exit-code --ignore-cr-at-eol -- package.json
52+
4453
- name: prepublish
4554
run: npm run vscode:prepublish
4655

@@ -78,6 +87,9 @@ jobs:
7887
- name: Build OSGi bundle
7988
run: npm run build-plugin
8089

90+
- name: Verify javaExtensions is in sync with server/
91+
run: git diff --exit-code --ignore-cr-at-eol -- package.json
92+
8193
- name: prepublish
8294
run: npm run vscode:prepublish
8395

@@ -115,6 +127,9 @@ jobs:
115127
- name: Build OSGi bundle
116128
run: npm run build-plugin
117129

130+
- name: Verify javaExtensions is in sync with server/
131+
run: git diff --exit-code --ignore-cr-at-eol -- package.json
132+
118133
- name: prepublish
119134
run: npm run vscode:prepublish
120135

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,18 @@
5656
"contributes": {
5757
"javaExtensions": [
5858
"./server/com.microsoft.java.test.plugin-0.43.1.jar",
59-
"./server/junit-jupiter-api_5.14.3.jar",
59+
"./server/junit-jupiter-api_5.14.4.jar",
6060
"./server/junit-jupiter-api_6.0.1.jar",
61-
"./server/junit-jupiter-engine_5.14.3.jar",
61+
"./server/junit-jupiter-engine_5.14.4.jar",
6262
"./server/junit-jupiter-engine_6.0.1.jar",
6363
"./server/junit-jupiter-migrationsupport_5.14.1.jar",
64-
"./server/junit-jupiter-params_5.14.3.jar",
64+
"./server/junit-jupiter-params_5.14.4.jar",
6565
"./server/junit-jupiter-params_6.0.1.jar",
66-
"./server/junit-platform-commons_1.14.3.jar",
66+
"./server/junit-platform-commons_1.14.4.jar",
6767
"./server/junit-platform-commons_6.0.1.jar",
68-
"./server/junit-platform-engine_1.14.3.jar",
68+
"./server/junit-platform-engine_1.14.4.jar",
6969
"./server/junit-platform-engine_6.0.1.jar",
70-
"./server/junit-platform-launcher_1.14.3.jar",
70+
"./server/junit-platform-launcher_1.14.4.jar",
7171
"./server/junit-platform-launcher_6.0.1.jar",
7272
"./server/junit-platform-runner_1.14.1.jar",
7373
"./server/junit-platform-suite-api_1.14.1.jar",

0 commit comments

Comments
 (0)