小编Rub*_*ado的帖子

Eclipse maven异常java.lang.ExceptionInInitializerError:无法访问属性的默认字段[在线程“Worker-27:Building”中]

我刚刚将 eclipse 更新到版本:2022-06 (4.24.0),并在问题视图中出现下一个异常(在 pom.xml 文件中):

异常 java.lang.ExceptionInInitializerError:无法访问属性的默认字段 [在线程“Worker-27:Building”中]

pom.xml 文件包含:

<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    ...
  </parent>
  <artifactId>xxxx</artifactId>
  <packaging>war</packaging>
  <properties>
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven.compiler.source>1.8</maven.compiler.source>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <dependencies>
    ...
  </dependencies>
  <repositories>
    <repository>
      ...
    </repository>
  </repositories>
  <build>
    <finalName>xxxx</finalName>
    <plugins>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <webXml>WebContent\WEB-INF\web.xml</webXml>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
Run Code Online (Sandbox Code Playgroud)

生成 Maven 工件时没有问题。

知道如何避免这些错误吗?

java eclipse maven

1
推荐指数
1
解决办法
7738
查看次数

标签 统计

eclipse ×1

java ×1

maven ×1