Fork me on GitHub


This warbucks-maven-plugin makes it possible to evaluate your project’s classes to ensure they are annotated as desired.

You can specify as many rules as you like, and each one will be evaluated in order. The build will fail if any rule fails. By default, it runs at the process-test-classes phase of the Maven build lifecycle. This is to ensure it runs after all classes have been compiled, but before any tests are run.

A rule is composed of a pattern for identifying the classes to evaluate, and a pattern for the annotations one requires to be used.

Getting Started

To add this plugin to your project, configure the plugin similarly to:

            <!-- Example rule to ensure Public integration tests have a JUnit Category -->
              <!-- a pattern of classes for which to check annotations -->
              <!-- include the classes which have Public modifier -->
              <!-- exclude the classes which have Package-private modifier -->
              <!-- exclude the classes which have Protected modifier -->
              <!-- exclude the classes which have Private modifier -->
              <!-- a pattern of annotations which are required for the specified classes -->
              <goal>check</goal><!-- runs at process-test-classes phase -->

and build your project, similarly to (it runs at the verify phase by default):

mvn verify