From 6f5a87f59fea6e0018a8ef8a32c40d5ce9d8ab54 Mon Sep 17 00:00:00 2001 From: Changyong Gong Date: Mon, 24 Nov 2025 16:09:01 +0800 Subject: [PATCH] fix: fix build failure for xml size limit --- package-lock.json | 2 +- scripts/buildJdtlsExt.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2e065a15..30187568 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "vscode-java-test", - "version": "0.43.1", + "version": "0.43.2", "dependencies": { "fs-extra": "^10.1.0", "get-port": "^4.2.0", diff --git a/scripts/buildJdtlsExt.js b/scripts/buildJdtlsExt.js index 87c29f2d..ddedeb8a 100644 --- a/scripts/buildJdtlsExt.js +++ b/scripts/buildJdtlsExt.js @@ -28,7 +28,10 @@ const bundleList = [ 'org.apiguardian.api', 'org.jacoco.core' ]; -cp.execSync(`${mvnw()} clean verify`, { cwd: serverDir, stdio: [0, 1, 2] }); +// Set MAVEN_OPTS to disable XML entity size limits for JDK XML parser +const env = { ...process.env }; +env.MAVEN_OPTS = (env.MAVEN_OPTS || '') + ' -Djdk.xml.maxGeneralEntitySizeLimit=0 -Djdk.xml.totalEntitySizeLimit=0 -DentityExpansionLimit=0'; +cp.execSync(`${mvnw()} clean verify`, { cwd: serverDir, stdio: [0, 1, 2], env }); copy(path.join(serverDir, 'com.microsoft.java.test.plugin/target'), path.resolve('server'), (file) => path.extname(file) === '.jar'); copy(path.join(serverDir, 'com.microsoft.java.test.runner/target'), path.resolve('server'), (file) => file.endsWith('jar-with-dependencies.jar')); copy(path.join(serverDir, 'com.microsoft.java.test.plugin.site/target/repository/plugins'), path.resolve('server'), (file) => {