Grails/GGTS 2.4.2 not putting plugins on classpath?

落花浮王杯 提交于 2020-01-04 14:17:25

问题


I am trying to update an older 1.3 Grails project to the latest Grails/Groovy/etc. So I downloaded Grails 2.4.2, Groovy 2.3, and Java 1.7.0_65. Then I imported the project via Import->Grails. I found out that plugins are now configured via the BuildConfig.groovy file, so I edited that with the plugins section and ran Grails Tools -> Update Dependencies. None of my plugins appear on the classpath? However, if I startup the plugin manager (which I'm not fully clear on why it is in the product as it states it won't do much after version 2.3...), it does list:

Plug-ins you currently have installed are listed below:
-------------------------------------------------------------
mail                1.0.6            --  Provides Mail support to a 
running Grails application
routing             1.2.0            --  Routing capabilities using 
Apache Camel
routing-jms         1.2.0            --  JMS integration for the 
grails-routing plugin
shiro               1.2.1            --  Apache Shiro Integration for Grails

So SOME part of Grails seems to know about the plugins. Also, if I delete the plugins from my $HOME/.grails/projects/myProject/plugins directory and re-run the Grails Tools -> refresh dependencies, I get both text on the console saying they are being installed and they come back to that directory.

The ONLY thing that seems abnormal, is that during the second set of files compiled (my project files) there ARE compile errors. I expected these (for instances of grailsApplication / etc). To fix them, I wanted to use GGTS - however, there are SO many compile errors in there from the plugins not being on the classpath it is not very feasible.

If anyone has ideas or suggestions for me to try that would be greatly appreciated!


回答1:


I think it's a problem with GGTS not knowing what your grails work directory is.

You can check you .project file to see if the .link_to_grails_plugins resource is defined correctly.

GGTS may have created the .project like this

<linkedResources>
    <link>
        <name>.link_to_grails_plugins</name>
        <type>2</type>
        <locationURI>GRAILS_ROOT/projects/myProject/plugins</locationURI>
    </link>
</linkedResources>

GRAILS_ROOT is a variable defined in your GGTS Preferences under General -> Workspace -> Linked Resources

You might have to add the variable if it's not there. Set the value to the absolute path for $HOME/.grails and then try to refresh your dependencies.



来源:https://stackoverflow.com/questions/24908769/grails-ggts-2-4-2-not-putting-plugins-on-classpath

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