상세 컨텐츠

본문 제목

[ Spring & Maven ] Maven error - Cannot access defaults field of Properties

BackEnd/Java

by SangHoonE 2021. 10. 12. 13:37

본문

반응형

안녕하세요 상훈입니다.

maven 프로젝트 빌드 중에 에러가 발생하였습니다.

Maven error Cannot access defaults field of Properties
Could not initialize class org.apache.maven.plugin.war.util.WebappStructureSerializer

 

이 두가지의 경우 입니다.

 

 stackoverflow에 등록된 내용으로 살펴보았을 때

 

Maven error Cannot access defaults field of Properties

I use the newest version of Java -> 16. When I run mvn clean, I am getting Could not initialize class org.apache.maven.plugin.war.util.WebappStructureSerializer error. I read that adding maven-war-

stackoverflow.com

 

프로젝트의 pom.xml 의 하단부plugin 이 있는데, 해당 내용을 변경해주시면 됩니다.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>3.3.1</version>
</plugin>
<plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>3.8.1</version>
</plugin>

 

신경써야할 부분은 오직 <artifactId><version> 이니, 다른 추가적인 내용은 무시하셔도됩니다.

artifactId가 일치하는지, version을 최신화 해주었는지 확인해주시면 됩니다.

그리고 저장update(ALT +  F5).
 간혹 1-2분 후에 에러가 없음 문구가 늦게 변경되는 경우도 있으니 참고 바랍니다.

 

 

 


 

 

maven dependency 내용

https://mvnrepository.com/search?q=+maven-war-plugin 

https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-compiler-plugin/3.8.1

 

 

참고 사이트

 

Could not initialize class org.apache.maven.plugin.war.util.WebappStructureSerializer

Could not initialize class org.apache.maven.plugin.war.util.WebappStructureSerializer 위와 같은 에러가 나올 때는 아래와 같이 플러그인을 추가해주면 된다.                   maven-war-plugin

jisblee.me

 

 

관련글 더보기

댓글 영역