Take the 2-minute tour ×

I would like to use a custom annotation in my project.

How can I configure maven 3 to process my annotation. The annotation and the implementation of the AbstractProcessor class are embedded in my application.

My annotation is available only for testing (src/test/java).

State annotation :

public @interface State {
  boolean success() default true;

TestAnnotationsProcessor :

public class TestAnnotationsProcessor extends AbstractProcessor {

    System.out.print("TESSST ANNOTATION");
    return true;

I don't want to put my annotation in an external project... it will be stupid because it's really dependend of my project.

How can I do that ? Thanks.

share|improve this question
What is the problem? Is maven ignoring the annotation during compilation? Or are you getting a problem similar to stackoverflow.com/questions/2335655/… –  Raghuram Feb 3 '12 at 12:57
Nothing happens, I would like to see in my console : "TESSST ANNOTATION" but nothing is displayed. –  Sandro Munda Feb 3 '12 at 13:13
add comment

1 Answer

up vote 2 down vote accepted

Could you do something like (forgive me if the syntax is a little off, I don't have my IDE handy):

share|improve this answer
add comment

Your Answer


