Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed plugin dependency @ BuildConfig.groovy #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ynov
Copy link

@ynov ynov commented Jan 3, 2014

$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

$grailsVersion causes error when resolving dependencies since there is no hibernate/tomcat plugin that have the same version with $grailsVersion
@pmcneil
Copy link
Collaborator

pmcneil commented Jan 9, 2014

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?

@ynov
Copy link
Author

ynov commented Jan 9, 2014

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.

@pledbrook
Copy link
Owner

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.

@pmcneil
Copy link
Collaborator

pmcneil commented Jan 10, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants