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

Dependency on GrailsWebUtil without exporting spring-test #50

Open
OsoRojo opened this issue Mar 14, 2014 · 0 comments
Open

Dependency on GrailsWebUtil without exporting spring-test #50

OsoRojo opened this issue Mar 14, 2014 · 0 comments

Comments

@OsoRojo
Copy link

OsoRojo commented Mar 14, 2014

The GSON converter (and maybe other places, not sure) has a dependency on GrailsWebUtil on or about line 57. GrailsWebUtil has a dependency on spring test, but you're not exporting the dependency in your plugin. If a user isn't utilizing spring-test, or they're not exporting it at run time, that results in a ClassNotFound error being thrown from GrailsWebUtils. To resolve (as many people have reported) you have to list a runtime dependency as follows:

runtime 'org.springframework:spring-test:3.2.8.RELEASE'

Several other people have reported this in a round-about way, but I don't think they're reporting it very clearly. They state it only affects war runs, etc. To be clear, so far as I can tell this affects ANY running application in dev or production mode that doesn't explicitly declare that dependency or get it transitively. I'm assuming your test app is getting it transitively from the spock dependency you have in the plugin, but I'm not positive about that.

I'd submit a patch, but I don't know how you want to fix it. The way I see it there are a few options:

  1. push it back up to the grails team as most people aren't going to be deploying spring-test jars with their war file, but they certainly might be using GrailsWebUtils. One could argue it's inappropriate to have Mocking functionality in that class since it's used in production code as well.
  2. Export the dependency from your plugin so new installs get it out the gate. May be an issue of versions though if they're also using spring-test
  3. List the dependency in the documentation / configuration.
  4. Change the plugin to get the content-type some other way.

Thoughts?

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

No branches or pull requests

1 participant