Declare a custom Grails command to use the 'build' scope

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Declare a custom Grails command to use the 'build' scope

Benjamin Wolff
Hi,

my question is whether it is possible to declare that a custom Grails commands needs the 'build' dependency scope loaded?

I have added a Grails command in the form a script in the "scripts" folder, it can be invoked on the command-line:

grails create-ear

This command falls under the category 'build', so I need the build scope to be present for some custom dependencies. However, when I invoke the command the dependencies I declare under 'build' scope are not resolved.

Thank you for any ideas!

Cheers,
Ben
Cheers,
Ben
Reply | Threaded
Open this post in threaded view
|

Re: Declare a custom Grails command to use the 'build' scope

Benjamin Wolff
Hello again,

I looked through other "build" Grails command scripts, like _GrailsWar, but I couldn't find anything obvious for resolving the build dependencies.

Do you maybe any ideas how to tell Grails "please the build dependencies for this script"?

Putting the dependencies in "compile" or "runtime" scope would cause them to be packaged in the WAR file, which shouldn't be the case. I could put them in "provided" scope, but the issue with that is that this scope is not inherited from Grails plugins to the application. I need to declare these dependencies in a plugin and want to avoid re-declaring them in every application that uses the Grails plugin.

Cheers,
Ben
Cheers,
Ben