grails-shiro icon indicating copy to clipboard operation
grails-shiro copied to clipboard

Fixed plugin dependency @ BuildConfig.groovy

Open ynov opened this issue 11 years ago • 4 comments

$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

ynov avatar Jan 03 '14 14:01 ynov

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?

pmcneil avatar Jan 09 '14 03:01 pmcneil

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.

ynov avatar Jan 09 '14 03:01 ynov

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.

pledbrook avatar Jan 09 '14 10:01 pledbrook

thinkin' the export = false option is probably the go and use $latest perhaps

pmcneil avatar Jan 10 '14 01:01 pmcneil