配置maven项目的开发时的默认jdk版本

配置所有maven项目的默认jdk版本,若不配置则提示"Warning:java: 源值1.5已过时, 将在未来所有发行版中删除"

在settings.xml文件中profiles标签中加入如下内容:

 1         <profile>   
 2             <id>jdk1.8</id>    
 3             <activation>   
 4                 <activeByDefault>true</activeByDefault>    
 5                 <jdk>1.8</jdk>   
 6             </activation>    
 7             <properties>   
 8                 <maven.compiler.source>1.8</maven.compiler.source>    
 9                 <maven.compiler.target>1.8</maven.compiler.target>    
10                 <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>   
11             </properties>   
12         </profile>

 

posted @ 2018-03-22 14:25  Schiller_Hu  阅读(125)  评论(0编辑  收藏  举报