-1

My attempt to follow suggested good practice and put plugins in BuildConfig.groovy instead of application.properties, won't work for database-migration. I have tried defining it with scopes of compile, build and runtime. When I run grails refresh-dependencies, I get this error message:

Error WARNING: Specified dependency definition runtime(database-migration:1.3.2) is invalid! Skipping..

(of course, the scope in the message varies with that specified). Is there another scope that I should use, or is this plugin special in some way? It's a shame that the message doesn't say what scopes are valid - that way I wouldn't have to ask this question :-)

I only want to use the plugin in the IDE to generate the xml files, and so I want to exclude it from the war file. Is that what 'export=false' indicates, if the required scope would include it by default?

I have to admit that I can't find a clear definition of the various scopes, and what scope includes what. Can anyone point me at something?

I should add that this is Grails 2.1.1, and GGTS 3.1.

John Ormerod
  • 117
  • 9
  • 1
    What _exactly_ did you put in BuildConfig, and where? Plugin dependencies look like `runtime(':database-migration:1.3.2')` (note the leading colon) and need to go in the `plugins` block, not the `dependencies` one. – Ian Roberts Feb 13 '13 at 18:29
  • 1
    Here's a [good summary](http://stackoverflow.com/questions/8751508/grails-buildconfig-groovy-difference-between-build-compile-and-runtime) of the scopes. – uchamp Feb 13 '13 at 18:31
  • From my BuildConfig.groovy: plugins { build(":tomcat:$grailsVersion", ":release:2.0.3", ":rest-client-builder:1.0.2") { export = false } runtime "database-migration:1.3.2" } The 'build' entries were generated when I created the project as a plugin. – John Ormerod Feb 13 '13 at 20:40
  • @uchamp Thanks for the link. I will bookmark. Though I can't work out if there is a scope that means 'use it for commands, but exclude from the war'. – John Ormerod Feb 13 '13 at 20:50

1 Answers1

0

I have just spotted my error. I hadn't noticed that there is a colon before the name of the plugin. I had:

runtime("database-migration:1.3.2")

what I should have written is:

runtime(":database-migration:1.3.2")

A combination of 'Duh!' and what a strange syntax that requires a colon before each term. Oh well, that's how it goes. Reminds me of a time in a customer back in dark ages, when a group of people were poring over a Cobol program that was misbehaving, and no could figure out why. I had a peep, even though I hardly knew Cobol. In a trice, I pointed out that a full-stop was missing after a 'if' statement and before the 'else'. At least a colon has two full-stops, so I may have to acknowledge that my eyesight ain't what it was...

John Ormerod
  • 117
  • 9