Maven을 통해 build를 하다보면 가끔 자바 버전의 하위호환성 문제로 인해 build가 되지 않을 때가 있다.
> 에러내용
에러내용중에 Java 버전과 관련된 내용이 포함되어 있음을 발견할 수 있다.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.000s
[INFO] Finished at: Sat May 08 11:06:22 KST 2010
[INFO] Final Memory: 3M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project HibernateEntity: Compilation failure: Compilation failure:
D:\workspace\HibernateEntity\src\main\java\kr\nextree\nexbay\domain\entity\User.java:[15,1] annotations are not supported in -source 1.3
(use -source 5 or higher to enable annotations)
@Entity
> 해결방법
pom.xml에 다음과 같이 maven compile plug-in을 선언하고 java 버전을 세팅해준다.
> 에러내용
에러내용중에 Java 버전과 관련된 내용이 포함되어 있음을 발견할 수 있다.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.000s
[INFO] Finished at: Sat May 08 11:06:22 KST 2010
[INFO] Final Memory: 3M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project HibernateEntity: Compilation failure: Compilation failure:
D:\workspace\HibernateEntity\src\main\java\kr\nextree\nexbay\domain\entity\User.java:[15,1] annotations are not supported in -source 1.3
(use -source 5 or higher to enable annotations)
@Entity
> 해결방법
pom.xml에 다음과 같이 maven compile plug-in을 선언하고 java 버전을 세팅해준다.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>