Comments (2)
On 29 Sep 2011, at 01:21, Felipe Rodrigues de Almeida wrote:
I was trying to use resources plugin with the latest version of JQuery.
On the plain JQuery plugin I could do that:
jquery {
sources = 'jquery' // Holds the value where to store jQuery-js files /web-app/js/
version = '1.6.4' // The jQuery version in use
}And the JQuery tag would know how to find that in my own /js/jquery/ directory.
<g:javascript library="jquery" />I don't want to update the plugin jquery version on the plugin directory, but the resources plugin can't find the .js on my dir. It keeps giving me this exception:
java.lang.IllegalArgumentException: Module [jquery] depends on resource [/plugins/jquery-1.6.1.1/js/jquery/jquery-1.6.4.min.js] but the file cannot be found
Hi Filipe,
Just override the "jquery" resource module using the "overrides" mechanism and point it at your new jquery version.
This is what the module declaration looks like in jQuery plugin:
// Resource declarations for Resources plugin
def jqver = org.codehaus.groovy.grails.plugins.jquery.JQueryConfig.SHIPPED_VERSION
modules = {
'jquery' {
resource id:'js', url:[plugin: 'jquery', dir:'js/jquery', file:"jquery-${jqver}.min.js"],
disposition:'head', nominify: true
}
'jquery-dev' {
resource id:'js', url:[plugin: 'jquery', dir:'js/jquery', file:"jquery-${jqver}.js"],
disposition:'head'
}
}
... so you just add your own AppResources.groovy or whatever you want to call it and add:
modules = {
overrides {
'jquery' {
resource id:'js', url:[dir:'js/jquery', file:"jquery-1.6.4.min.js"]
}
}
}
This will amend the module to point at your own file.
Make sense?
Thanks
Marc
~ ~ ~
Marc Palmer
Freelancer (Grails/Groovy/Java)
Founder @ http://noticelocal.com | Developer @ http://weceem.org
Member @ http://spottymushroom.com | Contributor @ http://grails.org
Twitter: http://twitter.com/wangjammer5 | Resumé: http://www.anyware.co.uk/marc/
Blog: http://www.anyware.co.uk | Grails Rocks: http://www.grailsrocks.com
from grails-resources.
Great,
It works, but it is not documented anywhere on the docs. Also, would be nice to have a convention. Look for the app version and then for the plugin version? Not sure it is easy to implement. Maybe with some exception fallback or some config instead of a convention.
By the way, thanks for the answer.
from grails-resources.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grails-resources.