title: Annotation processor @autoservice
body: <p>Need help with annotation processor . I have created a simple annotation processor which uses @autoservice annotation that checks whether the field which is annotated is final. But it is not showing any compile time errors. This is my configuration</p>
  
  <p>Annotation:</p>
  
  <pre><code>@Retention(RetentionPolicy.SOURCE)
  @Target(ElementType.FIELD)
  public @interface Store {
  
      int temp() default 0;
  }
  </code></pre>
  
  <p>Annotation Processor:</p>
  
  <pre><code>@SupportedAnnotationTypes("com.self.Store")
  @AutoService(Processor.class)
  public class Process extends AbstractProcessor {
  
      @Override
      public boolean process(Set&lt;? extends TypeElement&gt; annotations, RoundEnvironment roundEnv) {
  
          for (Element element : roundEnv.getElementsAnnotatedWith(Store.class)) {
  
              TypeElement typeElement = (TypeElement) element;
  
              for (Element element2 : typeElement.getEnclosedElements()) {
  
                  VariableElement variableElement = (VariableElement) element2;
  
                  if (!variableElement.getModifiers().contains(Modifier.FINAL)) {
  
                      processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, "it should be final");
                  }
  
              }
  
          }
  
          return true;
      }
  
  }
  </code></pre>
  
  <p>pom file:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;annotations&lt;/groupId&gt;
    &lt;artifactId&gt;annotations&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;name&gt;annotation&lt;/name&gt;
    &lt;dependencies&gt;
   &lt;dependency&gt;
        &lt;groupId&gt;com.google.auto.service&lt;/groupId&gt;
        &lt;artifactId&gt;auto-service&lt;/artifactId&gt;
        &lt;version&gt;1.0-rc2&lt;/version&gt;
        &lt;optional&gt;true&lt;/optional&gt;
      &lt;/dependency&gt;
    &lt;/dependencies&gt;
    &lt;build&gt;
      &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
          &lt;version&gt;3.5.1&lt;/version&gt;
          &lt;configuration&gt;
            &lt;source&gt;1.8&lt;/source&gt;
            &lt;target&gt;1.8&lt;/target&gt;
           &lt;/configuration&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Testing file:</p>
  
  <pre><code>public class Test {
  
       @Store
       public int id;
  }
  </code></pre>