Pergunta

I have a Gradle project (imported and generated using Eclipse's Gradle plugin) in Spring Tool Suite edition of Eclipse (3.2.0). It works most of the time, but sometimes, dependencies are getting out-of-sync between "Gradle Dependencies" and "Web App Libraries" in the project. Here is what I mean:

I define a compile dependency as following:

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

Then, after I do "Gradle -> Refresh All" I see that the dependency lib "myClient-0.2.1.jar" is in the list of the "Gradle Dependencies", and in the list under the "web App Libraries".

Now, after some time, I decide to use a newer version of this lib:

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

I again do "Gradle -> Refresh All", I also tried to refresh the project, re-build it, open/close the project and Eclipse, but what I see is:

The dependency under the "Gradle Dependencies" is indeed updated and is listed as "myClient-0.2.2.jar". But, the dependency under the "Web App Libraries" refuses to be updated and stays as "myClient-0.2.1.jar". this, obviously, wracks havoc to my app as now my code is not referencing correct newer classes and shows up all red in Eclipse.

One workaround that works sometimes is to nuke the whole project, and re-build it from scratch, but this is rather more radical than what I'd like to do :) And it does not work sometimes. It looks like I cannot explicitly control what goes into the "Web App Libraries" - so even though I see that a wrong lib is listed in the Project -> Properties -> Java Build Path -> Libraries -> Web App Libraries - I cannot change it there.

Any insight into this would be much appreciated, Thanks! Marina

Foi útil?

Solução

I had the same problem.

Try a gradle cleanEclipseWtp eclipseWtp, this worked for me. The WebApp libs will be up to date.

Best regards

Max

Outras dicas

1)delete it without deleting contents on disk
2)Import ... Existing projects into workspace and import the gradle-example project back
3)the Gradle Dependencies container is named nicely
4)restart Eclipse
5)the Gradle Dependencies container of the gradle-example project has the weird name I'm reporting

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top