开发者

GRAILS + Eclipse Project Dependencies

I am working on a Grails project that consists of a master grails-app and several grails plugins. One of the grails plugins is “Core” and contains several groovy and java domain and utility classes. Currently the core project is a grails plugin, however I’d like to pull the sources out of src/groovy and src/java into a Groovy class library that I’ll eventually package into a jar file.

I’d like to understand how to get this set up properly in Eclipse so that the plugins reference the new Groovy library and the application references the plugins and everything builds ok. If I spin up a grails plugin, and then add the groovy project to the build path using eclipse, I can get the plugin to build fine. The issue is, now I add a plugin reference from the grails web application to this plugin and the grails application won’t build. I have added the Groovy library to the build path of the web application, but when grails tries to add the plugin it complains that it doesn’t know about the classes in my groovy library. Here’s the 开发者_JAVA技巧project structure

server-core ( groovy project )

ia-security-plugin ( grails plugin project ) ( server-core is on the build path , builds fine )

server-core-web ( grails app project) ( references ia-security-plugin in Build.config ) ( won’t build )


During development add the following line to your BuildConfig.groovy

grails.plugin.location.'plugin-project'="../PluginProject"

where PluginProject is the eclipse project relative to your current project and plugin-project is the name of the plugin project. This takes the pain of rebuilding your plugins and all reference problems. You can even step debug through your main project into the plugin project.

For deployment time I have setup Artifactory with Maven Repository ID (on the plugin project) and [Main Project] BuildConfig.groovy to

compile (":plugin-name:latest.release")

along with

mavenRepo "http://location-of-local-artifactory/

Use http://grails.org/plugin/release for release management and repository setup.

Hudson automatically picks up the plugin and builds the war file on the build machine.

Alternatively you could simply build the war file and deploy to the server if your project is composed of just few developers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜