优雅的指尖

导航

Maven中配置默认JDK版本

使用Maven构建项目时,默认是使用jdk1.3版本,目前很多使用泛型的项目肯定是无法通过编译,除了修改项目的pom文件外,还可以在Maven的配置文件settings.xml中添加如下配置来解决:

 

[html] view plaincopy在CODE上查看代码片派生到我的代码片
 
  1. <profiles>       
  2.        <profile>         
  3.             <id>jdk-1.6</id>         
  4.             <activation>         
  5.                 <activeByDefault>true</activeByDefault>         
  6.                 <jdk>1.6</jdk>         
  7.             </activation>         
  8.             <properties>         
  9.                 <maven.compiler.source>1.6</maven.compiler.source>         
  10.                 <maven.compiler.target>1.6</maven.compiler.target>         
  11.                 <maven.compiler.compilerVersion>1.6</maven.compiler.compilerVersion>         
  12.             </properties>         
  13.     </profile>        
  14. </profiles>    

posted on 2014-03-01 23:02  优雅的指尖  阅读(826)  评论(0)    收藏  举报