Before moving onto looking at providing runtime configuration based on conventions you first need to understand how to evaluated those conventions from a plug-in. Essentially every plugin has an implicit application variable which is an instance of the GrailsApplication interface.

The GrailsApplication interface provides methods to evaluate the conventions within the project and internally stores references to all classes within a GrailsApplication using the GrailsClass interface.

A GrailsClass represents a physical Grails resources such as a controller or a tag library. For example to get all GrailsClass instances you can do:

application.allClasses.each { println it.name }

There are a few "magic" properties that the GrailsApplication instance possesses that allow you to narrow the type of artefact you are interested in. For example if you only want to controllers you can do:

application.controllerClasses.each { println it.name }

The dynamic method conventions are as follows:

The GrailsClass interface itself provides a number of useful methods that allow you to further evaluate and work with the conventions. These include:

For a full reference refer to the javadoc API.