grails-shiro
grails-shiro copied to clipboard
Fixed plugin dependency @ BuildConfig.groovy
$grailsVersion causes error when resolving dependencies since there is no hibernate/tomcat plugin that have the same version with $grailsVersion
I'm using the latest available version for both hibernate and tomcat plugin
This fix is probably going to break, since you just replace it with a specific dependency that won't be available for all versions of grails that uses this plugin. The $grailsVersion is/was the correct way to handle this. It may have changed. What version of grails are you finding a problem with?
I am using grails 2.3.4. The problem is when I am using $grailsVersion
, the grails
command fails to resolve the dependencies. It returned error like this:
| Error Resolve error obtaining dependencies: Failed to resolve
dependencies (Set log level to 'warn' in BuildConfig.groovy for more information):
- org.grails.plugins:hibernate:2.3.4
- org.grails.plugins:tomcat:2.3.4
Then I started to think since there's no hibernate 2.3.4 and tomcat 2.3.4, maybe I should replace $grailsVersion
with the specific version of hibernate and tomcat, but I don't know, maybe I'm totally wrong. It works for me.
But since I just replace it with a specific dependency, I might agree with you that it won't be available for all versions of grails that uses this plugin.
This is a tricky one. The Tomcat and Hibernate versions are now independent of the Grails versions, so plugins should definitely not be using $grailsVersion
. To be honest, the plugin needs to work out whether it requires Hibernate or not. Perhaps it could work with just GORM?
An alternative solution is to declare Hibernate with the export = false
option. That will mean application authors don't need to explicitly exclude the transitive Hibernate dependency. The plugin will simply use whatever version of the Hibernate plugin they've declared.
The final alternative is to declare the oldest possible version of the Hibernate plugin that could possibly work. It will then be automatically evicted by any Hibernate plugin version declared by the host application.
thinkin' the export = false option is probably the go and use $latest perhaps