Griffon: trouble downloading plugins?
In the past we relied on HTTP+SVN to resolve plugins at every time. This meant things went well as long as there was a reliable network connection. When the network was down so was Griffon for all purposes. We also had trouble accepting plugin contributions as SVN is not very social nor did we desired to open up SVN access with a generic user or some other scheme. These ailments plus some other more made us reach the conclusion that a full redesign of the plugin system was needed. And that's precisely what we did.
There are 3 types of artifact repositories under the new scheme: local, remote and legacy. The last one points to the old HTTP+SVN repository (in read-only now) where plugins used to be hosted. We're keeping it alive for a while as not all plugins have been migrated from legacy to new codebase (there are less than 10 if case you're interested to know). The second type is the one that currently serves plugins at http://artifacts.griffon-framework.org. This leaves the local type, which is the secret sauce that avoided lots of headaches for many. Every time a plugin is downloaded from the legacy or remote repositories you get a copy of the release metadata. This metadata plus the plugin itself are uploaded to the local repository. The next time the plugin needs to be resolved the local repository answers first, thus incurring in no penalty for network access as everything is resolved within the same file system.
All of the plugin related commands are aware of the different types of repositories and those configured for a particular environment. Simply type griffon list-repositories in case you'd like to see a list of all currently available repositories in your system.Here's what I get when running the command with default settings:
Available repositories are listed below:-----------------------------------------------------------------------Name Type Locationgriffon-local local /Users/aalmiray/.griffon/repositorygriffon-central remote http://artifacts.griffon-framework.org/griffon-legacy legacy http://svn.codehaus.org/griffon/plugins/Local repositories require nothing more than a name and a path in their configuration. Say you'd want to create a second local repository named test, this is what you'd have to place in $USER_HOME/.griffon/settings.groovy to configure such repository
griffon.artifact.repositories = [ test: [ type: 'local', path: '/tmp' ]]Running list-repositories once more results in
Available repositories are listed below:-----------------------------------------------------------------------Name Type Locationgriffon-local local /Users/aalmiray/.griffon/repositorytest local /tmpgriffon-central remote http://artifacts.griffon-framework.org/griffon-legacy legacy http://svn.codehaus.org/griffon/plugins/Alright, so the new repository will get asked second whenever plugins need to be resolved. You may be asking, how can I make the new repository be the default one for searching, storing and even publishing. We got you covered. The Griffon Guide describes all the options available at your disposal:
$ griffon -Dgriffon.artifact.repository.default.search='test' list-plugin miglayout$ griffon -Dgriffon.artifact.repository.default.install='test' install-plugin miglayout$ griffon -Dgriffon.artifact.repository.default.release='test' release-pluginCool, eh?
Though local repositories greatly reduce the number of times the griffon command line access the network when querying plugins it may still attempt to connect to outside servers when resolving JAR dependencies. If you're pretty certain all dependencies are already available in your local Ivy cache, or if you just want to disable checking for snapshot releases on every single dependency repository configured in BuildConfig.groovy then instruct Griffon to run in offline mode, like this
$ griffon -Dgriffon.offline.mode=true compileNo remote repository nor the legacy one will be queried as an added benefit of offline mode being active, only local repositories will be able to resolve artifacts. I set this flag all the time I'm on the train or an airplane (which happens more frequently than I would expect). This flag can even be placed inside $USER_HOME/.griffon/settings.groovy, turning Griffon into offline mode for every project until the flag gets disabled. Awesome.
Keep on Groovying!
griffon groovy
View the original article here
Posted By Unknown
Blog Rating 5 dari 5
0 comments:
Post a Comment