Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GRADLE_SERVER_OPTS variable overriden and not used for gradle server #1604

Open
shoblingr opened this issue Sep 10, 2024 · 1 comment
Open
Labels

Comments

@shoblingr
Copy link

Extension Name: vscode-gradle
Extension Version: v3.16.4
OS Version: Ubuntu
VSCode version: 1.93

Describe the bug
The system variable GRADLE_SERVER_OPTS is overriden and not taken in account by the gradle server instanciated by VSCode.
I used this variable to set proxy settings -Dhttps.proxyHost etc to be able to use it behind a proxy

To Reproduce
Steps to reproduce the behavior.
set GRADLE_SERVER_OPTS at system level, such as:
~$ echo $GRADLE_SERVER_OPTS
-Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8888 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=8888

Expected behavior
what was set in GRADLE_SERVER_OPTS is used in the extensions/vscjava.vscode-gradle-3.16.4/lib/gradle-server script and visible in the [info] JVM Args: --add-opens=java.base/java.util=ALL-UNNAMED... log message

Screenshots
NA

Output from "Gradle for Java"
[info] [gradle-server] Gradle Server started, listening on 35015
[info] Gradle client connected to server
[info] Java Home: /home/developer/.vscode-server/extensions/redhat.java-1.34.0-linux-x64/jre/17.0.12-linux-x86_64
[info] JVM Args: --add-opens=java.base/java.util=ALL-UNNAMED,--add-opens=java.base/java.lang=ALL-UNNAMED,--add-opens=java.base/java.lang.invoke=ALL-UNNAMED,--add-opens=java.prefs/java.util.prefs=ALL-UNNAMED,--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED,--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED,--add-opens=java.base/java.nio.charset=ALL-UNNAMED,--add-opens=java.base/java.net=ALL-UNNAMED,--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED,-XX:MaxMetaspaceSize=384m,-XX:+HeapDumpOnOutOfMemoryError,-Xms256m,-Xmx512m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant

Does the bug still exist if you disable all other extensions?
Yes

Additional context
NA

@shoblingr shoblingr added the bug Something isn't working label Sep 10, 2024
@jdneo
Copy link
Member

jdneo commented Sep 11, 2024

The related code should at

if (env["DEBUG_GRADLE_SERVER"] === "true") {
env.GRADLE_SERVER_OPTS =
"-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8089 " + GRADLE_SERVER_BASE_JVM_OPTS;
} else {
env.GRADLE_SERVER_OPTS = GRADLE_SERVER_BASE_JVM_OPTS;
}

We can append instead of replace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants