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

Optionally disable loading gradle from gradle wrapper (request) #875

Closed
jakegt1 opened this issue Apr 9, 2019 · 6 comments · Fixed by #917 or eclipse-jdtls/eclipse.jdt.ls#1026
Closed
Assignees
Milestone

Comments

@jakegt1
Copy link

jakegt1 commented Apr 9, 2019

It would be nice to be able to either optionally disable loading gradle from the gradle wrapper and always using system gradle (if higher then 2.6) so in cases where the gradle project is using a wrapper with a version < 2.6 the java plugin can still function.

Environment
  • Operating System: Mac OSX High Sierra
  • JDK version: 1.8
  • Visual Studio Code version: 1.32.3
  • Java extension version: 0.42.1
Steps To Reproduce
  1. Have gradle > 2.6 on path
  2. Have a gradle project that uses the wrapper with gradle < 2.6 (ex: 1.12)
  3. Redhat plugin complains about not being able to use the plugin with gradle < 2.6
Current Result

Can't use downstream plugins (checkstyle/run tests)

Wanted Result

Redhat plugin can optionally use system gradle always to at least allow some functionality on gradle 1.12 projects that use the wrapper

Additional Informations

I found this out while initially developing a project where it did not have the gradle wrapper with my gradle 5 system gradle version. I was able to run/debug tests and use checkstyle with no problems. I then added the wrapper, to find that afterwards i could not do either of these things because my gradle version (in the wrapper) was too low.

@fbricon
Copy link
Collaborator

fbricon commented Apr 9, 2019

Shouldn't be too difficult to implement

@SupinePandora43
Copy link

SupinePandora43 commented May 3, 2019

maybe also "java.gradlePath" ?!
"java.gradlePath": "system" //use global installed gradle
"java.gradlePath": "wrapper" //use workspace gradle wrapper
"java.gradlePath": "C:/Gradle/gradle-5.2.1" //use custom gradle path

@SupinePandora43
Copy link

SupinePandora43 commented May 7, 2019

//i'm edited comment

@SupinePandora43
Copy link

gradle path can be specified in "${opened folder}/.settings/org.eclipse.buildship.core.prefs", in line connection.gradle.distribution= set GRADLE_DISTRIBUTION(LOCAL_INSTALLATION(PATH_TO_GRADLE)) for using global gradle (or custom gradle path), or GRADLE_DISTRIBUTION(WRAPPER) for using wrapper in your folder

@snjeza
Copy link
Contributor

snjeza commented May 7, 2019

@SupinePandora43 you can try the following property:

"java.jdt.ls.vmargs": "-DGRADLE_HOME=C:/Gradle/gradle-5.2.1 -noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication",

@SupinePandora43
Copy link

@snjeza i don't need that, i configured gradle java home in gradle.properties, gradle path (WRAPPER) in .pref file. because minecraft forge dont support versions newer gradle 4.9, java 10. i'm got jdk 12 and jdk 8, gradle 5.2.1 and 4.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment