1.Static methods in interface require -target:jvm-1.8
解决方案:在pom中修改,参考:https://blog.csdn.net/YongDaiMe/article/details/108586263,在scala打包插件中增加-target :jvm-1.8配置。
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
</goals>
<configuration>
<addScalacArgs>-target:jvm-1.8</addScalacArgs>
</configuration>
</execution>
<execution>
<id>scala-test-compile</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
2、java和scala代码同时开发遇到打包java代码丢失问题,同步增加java和scala两个打包插件
参考:https://cloud.tencent.com/developer/article/1613727
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>