Runtime Selection

The selection of which Groovy runtime will be used is primarily controlled by the gmaven.runtime property.

For example, to use the Groovy 1.5 runtime:

mvn -Dgmaven.runtime=1.5 install

To always use the latest supported runtime the default provider key can be used:

mvn -Dgmaven.runtime=default install

This property is a comma-separated list of runtime provider keys, which will be used in the order in which they are listed. So in the example below, first the 1.5 runtime will be queried for availability (and support), then the 1.0 provider and then finally the default provider will be used.

mvn -Dgmaven.runtime=1.5,1.0,default install

Provider Information

Sometimes it helps to see what providers are configured. Use the groovy:providers goal to show some details about the discovered providers as well as which is selected based on the current execution environment.

Custom Versions

Custom versions of Groovy can be used if needed. Simply include a similar provider as a dependency, exclude the dependencies which need to be changed, then add them as dependencies.

Below is an example of using the 1.7 provider and configuring the provider to actually use Groovy 1.0.

NOTE

Icon

Be aware that the providers key will not change; the custom provider is still configured with a selection of 1.5.

If you end up needing a specific version of Groovy then you might be better of rolling your own provider model, and put all the dependency overrides in one place. Don't worry, in most cases you can use the provider/feature implementations from a supported provider and just customize the Groovy (and related) dependencies.