Speeding Up Grails Dependency Resolution
We're currently working on an app with a relative large number of external dependencies, as we're integrating with a fairly complex existing system.
The dependencies are working just fine, however, it still takes several minutes to resolve dependencies regardless of whether or not the dependencies are already in the Ivy cache. If the cache needs updating, it takes even longer of course.
Is there any way we can speed this process up, or disable dependency resolution on every run? This is now becoming a hug开发者_C百科e productivity drain.
Thanks!
Maybe it is a little tricky but i would do the following
- Use the enviroment element of config dsl to add dependecy resolution only in test e production see [here][1]
- Put all your depenecy jar in the lib forlder of your grails app I would do it with maven dependecy:copy. I think it could be done in ivy too
- Add the jar file to your scm-ignore-list
Use a CI build system to check dependecy resolution is done right
[1]: http://www.grails.org/doc/1.3.x/guide/3.%20Configuration.html#3.2 Environments
try using the --offline switch. this will avoid remote repositories and only search the file system (i.e., local maven repo). you only need to go back online when new dependencies are added.
I don't think there is a good way to get around the time it takes to do dependency resolution; as I understand it, it was a specific design decision in Grails to do the dependency resolution at startup time so that the app doesn't have to pull in dependencies during runtime.
You could get around this in dev mode at least by just leaving your Grails app running and hot-deploying any changes - if you're using one of the recent Grails versions with the embedded Tomcat server, this works really well.
精彩评论