idea自動重置language level和java compiler的解決
1.需求分析
很多同學可能會遇到這種情況,某次載入多模組的工程時,會報java compiler不合理的錯誤,這是要重新配置language level和java compiler的節奏;
2.場景還原
①載入新工程,一般會拋錯
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project rkk-api: Compilation failure...
Usage of API documented as @since 1.8+ less... (Ctrl+F1) This inspection finds all usages of methods that have @since tag in their documentation...
②根據該問題 配置java compiler,配置language level(具體配置不再贅述)。這樣配置後,基本上ok了,但是重新載入後,這種情況很可能還會出現。
3.殺手鐗
在父工程的pom中新增如下配置
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
這樣就不用重複2中的配置,在此推薦殺手鐗 簡潔有效!
---------------------
原文:https://blog.csdn.net/zhangxing52077/article/details/78728040
版權宣告:本文為博主原創文章,轉載請附上博文連結!