What should be in the build.gradle file to support imports of the standard groovy libraries

*爱你&永不变心* 提交于 2019-12-11 08:35:54

问题


I had created a groovy project. It worked by itself.

After some additions I had to add a new jar of a new library into the imports.

While the whole workspace runs on Gradle, I added the appropriate Maven reference to the gradle.build file.

After running gradle cleanEclipse Eclipse the new library works OK.

But. All project references to the Groovy libraries disappeared. Foolish me, I had to put some references to them into the gradle.build, too.

The list of libraries:

groovy.util.slurpersupport
groovy.xml
org.codehaus.groovy.tools.xml
groovy.lang

But I don't know how to include them into gradle.build. I can't found them in maven repository. And even so, I have them installed in my Eclipse, and I should take these. And I can't google any help, because gradle groovy gives the results on how to call gradle from groovy, not vice versa.

Moving from plain Groovy to Gradle won't help, it is really about gradle support for calling a java library from groovy.

I have nothing against getting dependencies from Maven rep., but I don't know how to do it in my case - The problem is, that I have Eclipse 3.6. And I should use the last version of groovy for Eclipse 3.6. So, I have installed it from http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.6/. And I don't know what is the equivalent version in Maven - there is no info about it.


回答1:


There was some error in the groovy in Eclipse installation. Now after running gradle cleanEclipse Eclipse while build.gradle has NO dependencies to groovy, almost everything runs OK, I only have to add the groovy nature to the project



来源:https://stackoverflow.com/questions/15840408/what-should-be-in-the-build-gradle-file-to-support-imports-of-the-standard-groov

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!