解决创建maven项目默认jdk版本是1.5 的问题

找到自己解压的maven

打开setting.xml

创建一个子节点如下:

<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> 
          <maven.compiler.encoding>utf-8</maven.compiler.encoding>   
        </properties>    
      </profile>  
 

保存。

刷新一下maven工程 Alt+F5 刷新完成,就会发现已经更新了jdk版本

猜你喜欢

转载自blog.csdn.net/star1210644725/article/details/82960878