Skip to content

Commit 5d6230c

Browse files
authored
Merge pull request #229 from jGauravGupta/FISH-9450
FISH-9450 Payara Tools for VSCode fails to pass environmental variables and start a Payara Micro instance
2 parents 73e48f8 + fb51bf5 commit 5d6230c

2 files changed

Lines changed: 14 additions & 13 deletions

File tree

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@
227227
},
228228
{
229229
"command": "payara.server.app.migrate",
230-
"title" : "Transform to Jakarta EE 10",
230+
"title": "Transform to Jakarta EE 10",
231231
"category": "Payara"
232232
},
233233
{
@@ -725,6 +725,7 @@
725725
"gradle-to-js": "^2.0.0",
726726
"lodash": "^4.17.21",
727727
"open": "^8.4.2 ",
728+
"payara-vscode": "file:",
728729
"request": "^2.88.0",
729730
"tail": "^2.0.3",
730731
"tmp": "^0.2.0",
@@ -736,8 +737,8 @@
736737
"@types/glob": "^8.0.0",
737738
"@types/lodash": "^4.14.155",
738739
"@types/mocha": "^10.0.0",
739-
"@types/node": "^20.3.1",
740-
"@types/vscode": "^1.22.0",
740+
"@types/node": "^22.5.4",
741+
"@types/vscode": "^1.93.0",
741742
"glob": "^7.1.7",
742743
"mocha": "^10.0.0",
743744
"os": "^0.1.1",

src/main/fish/payara/project/Maven.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,14 @@ export class Maven implements Build {
132132
}
133133

134134
let jdkHome;
135-
let env: any = {};
135+
let env = { ...process.env };
136136
if (this.payaraInstance && (jdkHome = this.payaraInstance.getJDKHome())) {
137137
env['JAVA_HOME'] = jdkHome;
138138
}
139139

140-
let process: ChildProcess = cp.spawn(mavenExe, args, { cwd: this.workspaceFolder.uri.fsPath, env: env });
140+
let mvnProcess: ChildProcess = cp.spawn(mavenExe, args, { cwd: this.workspaceFolder.uri.fsPath, shell: true, env: env});
141141

142-
if (process.pid) {
142+
if (mvnProcess.pid) {
143143
let outputChannel = ProjectOutputWindowProvider.getInstance().get(this.workspaceFolder);
144144
if (silent !== true) {
145145
outputChannel.show(false);
@@ -152,16 +152,16 @@ export class Maven implements Build {
152152
outputChannel.append(data.toString());
153153
dataCallback(data.toString());
154154
};
155-
if (process.stdout !== null) {
156-
process.stdout.on('data', logCallback);
155+
if (mvnProcess.stdout !== null) {
156+
mvnProcess.stdout.on('data', logCallback);
157157
}
158-
if (process.stderr !== null) {
159-
process.stderr.on('data', logCallback);
158+
if (mvnProcess.stderr !== null) {
159+
mvnProcess.stderr.on('data', logCallback);
160160
}
161-
process.on('error', errorCallback);
162-
process.on('exit', exitCallback);
161+
mvnProcess.on('error', errorCallback);
162+
mvnProcess.on('exit', exitCallback);
163163
}
164-
return process;
164+
return mvnProcess;
165165
}
166166

167167
public getDefaultHome(): string | undefined {

0 commit comments

Comments
 (0)