Eclipse Gradle Dependencies Not Updated in Web Application Libraries

I have a Gradle project (imported and generated using Eclipse Gradle) in the Spring Tool Suite Eclipse version (3.2.0). It works most of the time, but sometimes dependencies get out of sync between the Gradle Dependencies and the Web Application Libraries in the project. Here is what I mean:

I define the compilation dependency as follows:

compile(group: 'com.mygroup', name: 'myClient', version: '0.2.1') 

Then, after I do "Gradle -> Update All", I see that the lib dependency "myClient-0.2.1.jar" is in the "Gradle Dependencies" list, and in the list under "Web Application Libraries".

Now, after a while, I decided to use a newer version of this library:

 compile(group: 'com.mygroup', name: 'myClient', version: '0.2.2') 

I do "Gradle β†’ Refresh All" again, I also tried to update the project, rebuild it, open / close the project and Eclipse, but I see:

The dependency in the "Gradle" dependencies is indeed updated and displayed as "myClient-0.2.2.jar". But the dependency in the "Web Application Libraries" refuses to be updated and remains "myClient-0.2.1.jar". this obviously destroys the chaos for my application, since now my code does not reference the correct new classes and displays all the red ones in Eclipse.

One way that sometimes works is to destroy the whole project and rebuild it from scratch, but this is more radical than what I would like to do :) And sometimes it doesn’t work. It seems that I can not explicitly control what is included in the "Web Application Libraries", so although I see that the wrong library is listed in Project -> Properties -> Java Build Path -> Libraries -> Web Application Libraries - I can not change it there.

Any understanding of this would be greatly appreciated, Thank you! Marina

+4
source share
2 answers

I had the same problem.

Try gradle cleanEclipseWtp eclipseWtp, it worked for me. WebApp library will be updated.

Best wishes

Max

+6
source

1) delete it without deleting the contents on the disk
2) Import ... Existing projects into the workspace and import the gradle -example project back

3) Gradle container Dependencies called beautifully
4) reboot Eclipse
5) Gradle container Dependencies of the project gradle -example has a strange name that I'm reporting

0
source

Source: https://habr.com/ru/post/1485812/


All Articles