maven创建工程jdk设置为1.6

如果你用eclipse建立maven项目时,新建的项目往往JDK版本很低——1.5!怎么办?修改settings.xml文件,增加profile节点,如下所示: 

Java代码   收藏代码
  1. <profile>    
  2.     <id>jdk-1.6</id>    
  3.     <activation>    
  4.         <activeByDefault>true</activeByDefault>    
  5.         <jdk>1.6</jdk>    
  6.     </activation>    
  7.     <properties>    
  8.         <maven.compiler.source>1.6</maven.compiler.source>    
  9.         <maven.compiler.target>1.6</maven.compiler.target>    
  10.         <maven.compiler.compilerVersion>1.6</maven.compiler.compilerVersion>    
  11.     </properties>    
  12. </profile>  

猜你喜欢

转载自sxlkk.iteye.com/blog/2256647