IDEA:MAVEN:先:An illegal reflective access operation has occurred 后:Cannot access defaults field of Properties

发布时间 2023-07-04 12:43:53作者: 双休日

maven打包发现出现以下警告,但是可以运行

 通过在

 VM选项中添加  --illegal-access=deny --add-opens java.base/java.lang=ALL-UNNAMED 

不再出现刚才提示。

之后出现

Cannot access defaults field of Properties

发现自己新创建的项目,没有配置相应插件就使用了。添加即可。

<plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-war-plugin</artifactId>
          <version>3.2.0</version>
        </plugin>
      </plugins>