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

Local Gradle install is not used when java.import.gradle.home is set #1004

Closed
brendansailer opened this issue Sep 16, 2021 · 6 comments · Fixed by #1036
Closed

Local Gradle install is not used when java.import.gradle.home is set #1004

brendansailer opened this issue Sep 16, 2021 · 6 comments · Fixed by #1036
Assignees
Labels
bug Something isn't working enhancement New feature or request
Milestone

Comments

@brendansailer
Copy link

Extension Name: vscode-gradle
Extension Version: 3.6.1
OS Version: Centos 7
VSCode version: 1.54.3

Describe the bug
Despite having java.import.gradle.home set to my local directory which has a Gradle 5.6.4 installed, it tries to download Gradle from the internet.

To Reproduce
Set java.import.gradle.wrapper.enabled to false, java.import.gradle.home to the proper directory, and java.import.gradle.version to the proper version. Then reload your window and it'll still download Gradle. If you leave off the version setting, you get an error so I believe that's required.

Expected behavior
Use my local Gradle install first rather than reaching out to the internet.

Output from "Gradle Tasks"
The first three lines are it connecting to the server and trying to download Gradle.

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

Thanks for the help! I couldn't figure out how to get an account on Slack, so I posted an issue here. Also it'd be nice to have the extension enabled when it detects a build.gradle file and you have the wrapper disabled. Good first issue?

@brendansailer brendansailer added the bug Something isn't working label Sep 16, 2021
@CsCherrYY
Copy link
Collaborator

We have fixed this bug in 3.7.0. Could you please try again?

@brendansailer
Copy link
Author

@CsCherrYY I just upgraded to 3.7.0 and it works! However it causes an error in another extension: "Cannot activate the 'Spotless Gradle' extension because it depends on an unknown 'richardwillis.vscode-gradle' extension." Is this a problem with Spotless Gradle needing to update to 'microsoft.vscode-gradle'?

Also, if we disable the gradle wrapper the extension should still be active and appear even without a gradlew or gradlew.bat file. Is this something you have planned to implement?

@CsCherrYY
Copy link
Collaborator

Is this a problem with Spotless Gradle needing to update to 'microsoft.vscode-gradle'?

Yes. @badsyntax has a plan to update the Spotless Gradle extension, which will include this change.

Also, if we disable the gradle wrapper the extension should still be active and appear even without a gradlew or gradlew.bat file. Is this something you have planned to implement?

A perfect suggestion. Let's make it in the improvement plan.

@CsCherrYY CsCherrYY added this to the 3.8.1-Oct 2021 milestone Sep 23, 2021
@CsCherrYY CsCherrYY self-assigned this Sep 23, 2021
@CsCherrYY CsCherrYY added the enhancement New feature or request label Sep 23, 2021
@CsCherrYY
Copy link
Collaborator

@brendansailer I see a new version of Spotless Gradle has been released, and the issue you mentioned seems to be fixed already. Could you have a try?

@brendansailer
Copy link
Author

brendansailer commented Sep 23, 2021

@CsCherrYY Yup the issue I mentioned is fixed in Spotless Gradle - my apologizes for not updating my comment.

Thanks for adding it to the improvement plan that is great! My experience with vscode extensions is limited, but I don't think it'd be super hard to implement and it would be a big improvement. I feel like many users aren't aware you need a gradlew or gradlew.bat file for the extension to work.

@CsCherrYY
Copy link
Collaborator

verified in #1048

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants