본문 바로가기

개발/기타

dynamic web module 3.0 requires java 1.6 or newer in Maven Project

메이븐으로 프로젝트를 생성 도중 


'dynamic web module 3.0 requires java 1.6 or newer'와 

'one or more constraints have not been satisfied'

머시기 라는 에러 메시지가 발생했다.


구글링 끝에 이 문제를 해결했다.


영어가 딸리기 때문에 그림만 보고 따라함.(자바 1.7, 다이나믹 웹 3.0 기준)

1. 이클립스 상단메뉴 project > properties > java compiler 에서

compiler compliance level을 1.7로 맞춘다.


2. project facet 에서 java 버전을 1.7 맞춘다.


3. 이클립스 상단메뉴 preferences > java > installed jres 에서 add를 누른후 자신이 설치한 자바 경로 설정.


4. pom.xml에서 maven 설정 프로퍼티를 아래와 같이 해준다.


<build>
    <plugins>
        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
            <source>1.7</source>
            <target>1.7</target>
        </configuration>
    </plugin>
    </plugins>
</build>

5. 프로젝트 오른쪽 마우스 누른 후 maven > update project를 누른다.


이렇게 했더니 에러 문구 사라짐.

출처 : http://qussay.com/2013/09/13/solving-dynamic-web-module-3-0-requires-java-1-6-or-newer-in-maven-projects/