Chapter 16. Plugin development
In this chapter
- How plugins work
- Writing your own plugins
- Managing plugin repositories
We looked at build integration and project management in the previous chapter, so now we’ll look at a way to modularize and extend your application by developing your own plugins. We introduced you to the Grails plugin system back in chapter 8, and you saw then how useful plugins can be. They’re a fundamental and powerful part of the Grails infrastructure, and even if you never need to write your own plugins, understanding how the system works will set you in good stead for the future.
When might you need or want to create your own plugin? We don’t want to limit your thinking on this, but here are three common uses:
- Integrating an existing library or tool into Grails
- Providing a specific feature
- Modularizing an application
You’ve already seen many examples of the first use, such as Searchable (which integrates Compass), Spring Security, and others. The Authentication and Functional Test plugins are examples of the second use, providing access control and functional testing respectively. The difference between those two uses is more technical than practical, so it’s not necessarily worth distinguishing between them.