I'm using vscode for gradle multi-module project d...
# community-support
s
I'm using vscode for gradle multi-module project development .. i'm facing wierd issues.. whenever i'm making changes in build.gradle, those are not getting reflected under classpath.. like adding dependency/removing dependency etc.. due to that i'm ending up running
gradle build
from command line every time.. this is painful despite using sophisticated IDE .. i tried various options suggested over internet but none of them are working..
I tried deleting
workplaceStorage
under AppData Vscode cache .. it worked once.. but again same problem.. this is so irritating not knowing issues on-the-fly whenever dependencies corrected in
build.gradle
file..
Not sure this is vscode issue or gradle issue..
v
I wouldn't call a fancy text editor a "sophisticated IDE", especially when you can use good stuff like IntelliJ IDEA. 😄 But besides that, in IntelliJ IDEA for example the default is, that if the build scripts are changed outside the IDE it auto-syncs to get the updates, but if you change the build scripts from within the IDE it does not auto-sync to not constantly sync while you edit the build scripts. So there (unless you changed the default settings) you have to manually trigger a resync when editing the build scripts inside the IDE. Maybe it is similar in the VSC integration. But yes, if there is an issue, it is more with the VSC integration, not with Gradle.
s
I did refreshing gradle projects mutliple times in vscode editor as automatic not working.. but still no luck.. when i open project first time, whatever the classpath it has, its not at all getting changed..
Infact, i'm facing the same issue even with eclipse too
let me try in intellij idea
Especially i'm facing this issue with multi-module project setup.. for individual projects, i dont see any issues.. donno whats wrong.. 😞
v
Never had anything like that with IJ and I work with a lot of different and also multi module projects. 🤷‍♂️ I'd expect the Eclipse integration also to work properly though as Buildship is maintained by the Gradle folks as far as I remember, but I try to not touch Eclipse with a five foot pole if I can avoid it. :-D
😅 1
s
I installed IJ, found similar issue there too.. im not able to figure.. i enabled these settings (want to sync project for any changes in build.gradle file) So for testing purpose, i commented one dependency . .i see gradle tasks are running.. but its not showing compilation errors on left side navigation pane unless i open particualr java file .. Attached 2nd screenshot.. those error markers not visible,...(check 2nd screenshot) i opened the java file, it shows compilation errors.. check 3rd screenshot... im confused.. i tried in single module project now .. looks like its not multi-module project issue.. problem is generic.. its very difficult to find out like this which has errors upon making changes in build.gradle file.. i think i'm missing something while dealing with these IDEs.. :(
v
Cannot speak for the other IDEs, but in IntelliJ Syncing with Gradle just means that the project information like dependencies and so on are updated. It does not mean that anything is automatically compiled and thus errors displayed. At least not when not having activated it, which is disabled by default. There is an option "Build project automatically" that would hopefully do what you expect.