解决 Eclipse pom.xml 提示 Cannot access defaults field of Properties
早上打开 Eclipse 的 Maven Web 项目,显示 pom.xml 文件报错,如下:

一开始,以为是 项目没刷新,maven update 几次,还是提示,然后百度了一下。发现是 war 包插件的问题。解决方法也挺简单,指定一个 war 包插件即可。添加 pom.xml 内容,如下:
<!-- war --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>3.3.1</version> </plugin>
效果图如下:

然后保存,刷新下项目 maven update 一下,即可。
参考文献:
[1] Eclipse下pom.xml的提示 Cannot access defaults field of Properties - pmh905001 - 博客园 (cnblogs.com)
[2] Cannot access defaults field of Properties问题的解决-CSDN博客