maven 使用记录之修改 maven默认jdk版本



maven package执行的时候会遇到jdk版本不对的问题 :原因是 maven所指定的jdk版本与项目使用的jdk版本不一致
1.项目属性的 java compiler可以设置
2.直接修改 maven 的 settings.xml 一劳永逸

settiings.xml  <profiles>标签内加入


  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>

原文地址:https://www.cnblogs.com/signheart/p/6609566.html