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
[ERROR] found : my.package.MyClass.MyEnum
[ERROR] required: my.package.MyClass.MyEnum
Then I ensured that my/package/MyClass.java
need to compile first so I added
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
<executions>
<execution>
<id>default-compile</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<excludes>
<exclude>**/*.*</exclude>
</excludes>
<includes>
<include>**/MyClass.java</include>
</includes>
</configuration>
</execution>
<execution>
<id>second</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<includes>
<include>**/*</include>
</includes>
<excludes>
<exclude>**/MyClass.java</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>
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.
package com.formativesoft.mcserp.validator;
public class Validator {
public enum Lang {
EN, BN;
}
}