Contents
see List작성일 2016. 02. 06.
이클립스 Maven Update Project 시 자바 버전 변경 방지
Maven Update Project를 실행할 때마다 Java 버전이 1.5로 변경되는 문제를 해결하는 방법입니다.
문제 상황
Maven Update Project (Alt+F5) 실행 후 Java 컴파일러 버전이 의도치 않게 변경됩니다.
해결 방법
pom.xml에 maven-compiler-plugin 설정을 추가합니다.
pom.xml 설정
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
Java 11 이상인 경우
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<release>11</release>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
properties 방식 (간단한 방법)
<properties>
<java.version>1.8</java.version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
Spring Boot 프로젝트
<properties>
<java.version>11</java.version>
</properties>
적용 후 확인
- pom.xml 저장
- 프로젝트 우클릭 → Maven → Update Project (Alt+F5)
- 프로젝트 우클릭 → Properties → Java Compiler에서 버전 확인
추가 팁
- 이클립스 재시작이 필요할 수 있음
- .settings 폴더의 org.eclipse.jdt.core.prefs 파일에서 버전 확인 가능
- Update Project 시 "Force Update of Snapshots/Releases" 체크 권장
.classpath 파일 확인
<!-- JRE System Library 버전 확인 -->
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/
org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>tool
| No | 작성일 | Title |
|---|---|---|
| 2144 | 2026. 02. 11. | GitHub Actions 고급 워크플로우 설계 패턴 |
| 2143 | 2026. 02. 11. | Docker Compose v2와 컨테이너 오케스트레이션 실전 |
| 2142 | 2026. 02. 11. | Claude Code 완전 가이드: AI 코딩 에이전트 활용법 |
| 2033 | 2025. 11. 30. | Grafana + Prometheus 모니터링 구축 |
| 2032 | 2025. 11. 30. | Terraform으로 인프라 코드화 (IaC) |
| 2031 | 2025. 11. 30. | Vim 에디터 기초와 생산성 향상 |
| 2030 | 2025. 11. 30. | Postman으로 API 테스트 자동화 |
| 2029 | 2025. 11. 30. | Jenkins CI/CD 파이프라인 구축 |
| 2028 | 2025. 11. 30. | Maven vs Gradle - 빌드 도구 비교 |
| 2027 | 2025. 11. 30. | IntelliJ IDEA 생산성 향상 단축키 |