title: How to compile Java Enum in Maven?
body: <p>Most recently I am working with maven 3.x, Eclipse Juno JavaEE IDE with JDK 1.6.0_26. Some where in my project I used enum both inside and outside of a class. When I run clean build it appear an error</p>
  
  <pre><code>[ERROR] found   : my.package.MyClass.MyEnum
  [ERROR] required: my.package.MyClass.MyEnum
  </code></pre>
  
  <p>Then I ensured that <code>my/package/MyClass.java</code> need to compile first so I added </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.3.2&lt;/version&gt;
      &lt;configuration&gt;
          &lt;source&gt;1.6&lt;/source&gt;
          &lt;target&gt;1.6&lt;/target&gt;
      &lt;/configuration&gt;
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;id&gt;default-compile&lt;/id&gt;
              &lt;goals&gt;
                  &lt;goal&gt;compile&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                  &lt;excludes&gt;
                      &lt;exclude&gt;**/*.*&lt;/exclude&gt;
                  &lt;/excludes&gt;
                  &lt;includes&gt;
                      &lt;include&gt;**/MyClass.java&lt;/include&gt;
                  &lt;/includes&gt;
              &lt;/configuration&gt;
          &lt;/execution&gt;
          &lt;execution&gt;
              &lt;id&gt;second&lt;/id&gt;
              &lt;goals&gt;
                  &lt;goal&gt;compile&lt;/goal&gt;
              &lt;/goals&gt;
              &lt;configuration&gt;
                  &lt;includes&gt;
                      &lt;include&gt;**/*&lt;/include&gt;
                  &lt;/includes&gt;
                  &lt;excludes&gt;
                      &lt;exclude&gt;**/MyClass.java&lt;/exclude&gt;
                  &lt;/excludes&gt;
              &lt;/configuration&gt;
          &lt;/execution&gt;
      &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>After that it is not work hopefully. It's very much annoying to me. If I had to use enum in my application how do I will overcome it. Someone trying to prove in their blog it is the bug java 1.6.0_26 and fixed in JDK 7. If so it is not possible to migrate to JDK 7.x. Any way to solve this problem with maven 3.x with Eclipse JNO Java EE.</p>
  
  <pre><code>package com.formativesoft.mcserp.validator;
  
  public class Validator {
  
      public enum Lang {
          EN, BN;
      }
  }
  </code></pre>