A Maven plugin to power up your Maven builds with custom java code

Maven offers a lot of standard plugins that let you write fully automated and reliable builds. You can even develop your own plugins if you have some specific needs. But it can be complicated to make a separate project for your custom plugin with a separate release lifecycle. Wouldn’t it be easier if you could just put your build code directly inside the project?

builder-maven-plugin adds a src/build/java folder on your project

Source structure

Then you just write java classes with a few annotations in order to bind them to standard maven lifecycle.

Source example

Fork me on GitHub

In the end, you will still have a pom.xml file with the essential informations of the project (dependencies, scm…) but for all the more custom tasks, no more need to use a complex and poorly documented maven plugin, no more need for maven-antrun-plugin, you just code java in the project. This is only some examples of What you can do :

  • generate java classes
  • scan the project for some annotations and do some stuff (at build time, not at runtime like with Spring!)
  • generate documentation pages
  • start an embedded database before launching your unit tests
  • use any of the many libraries that can make cool stuff but don’t have a maven plugin
  • anything else you cannot do with an existing maven plugin

Where to start?