티스토리 뷰

study/Error

[Error] maven-war-plugin

xoxowo 2023. 1. 30. 16:44

chap 09 예제 학습 중 예제에 나와있는 그대로 pom파일을 작성했는데 오류가 발생했다.

 

문제가 발생했던 war 설정 

 

 

추가된 war 설정에 x표시가 떠서 [Run As] → [Maven clean] 실행 후  [Maven install]을 실행했는데 실패하고 아래와 같이 ERROR 문구가 Console 창에 떴다.

 

 

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project sp5-chap09 Execution default-war of goal org.apache.maven.plugins:maven-war-plugin:2.2:war failed: Unable to load the mojo 'war' in the plugin 'org.apache.maven.plugins:maven-war-plugin:2.2' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLoo kupException: Cannot access defaults field of Properties

 

원인

웹 배포 파일인 war을/를 만들어 주는 플러그인이 없어 발생한 것

 

📌 해결 방법

pom.xml파일 <plugin> 부분에 maven war plugin 설정을 추가하면 된다.

 

<plugin>
     <artifactId>maven-war-plugin</artifactId>
     <version>3.2.2</version>
</plugin>

 

+ 추가로 예제 파일의 pom.xml 에 dependency에 들어가있던 org.apache.maven.plugins을 plugin위치에 알맞은 버전으로 수정하니 에러가 해결되었다.. 멍청멍청 😭

 

 

 

문제해결에 도움을 준 고마운 블로그 글 

댓글