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
版权声明:本文为博主原创文章,转载请附上博文链接!