maven工程:
错误: -source 1.6 中不支持 diamond 运算符。
尝试按网的的方式修改后,自动恢复,也在pom文件指定版本,依然不行。
后来发现:pom这样配置了:
<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.source}</target>
                </configuration>
            </plugin>

  写死1.8还是失败。

最后,发现是引用的setting.xml文件上面配置了1.6,改为1.8即可。

<profile>
        <id>jdk-1.8</id>
        <activation>
            <activeByDefault>true</activeByDefault>
            <jdk>1.8</jdk>
        </activation>
        <properties>
            <maven.compiler.source>1.8</maven.compiler.source>
            <maven.compiler.target>1.8</maven.compiler.target>
            <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
        </properties>
    </profile>

  

相关文章:

  • 2021-11-08
  • 2021-08-09
  • 2021-10-24
  • 2021-05-03
猜你喜欢
  • 2021-08-07
  • 2021-09-09
  • 2022-12-23
  • 2021-04-22
  • 2021-12-03
  • 2021-11-21
  • 2021-06-07
相关资源
相似解决方案