springboot 使用maven 打包 报 (请使用 -source 7 或更高版本以启用 diamond 运算符) 错误解决办法

在使用springboot maven 打包时 报如下错误 (请使用 -source 7 或更高版本以启用 diamond 运算符)

pom.xml编译插件 配置如下:

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
</plugin>

在网上查了一下,解决方式如下:

<plugin>

           <artifactId>maven-compiler-plugin</artifactId>
        
           <configuration>
        
              <source>1.8</source>
        
              <target>1.8</target>
        
           </configuration>
        
</plugin>

使用上面代码替换之前的配置,在进行打包问题就解决了。

猜你喜欢

转载自www.cnblogs.com/yg_zhang/p/10605126.html