maven 修改使用jdk版本

方式1、修改maven全局jdk

    

    修改 安装目录\maven2\conf\settings.xml

 

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

 

 

方式2、修改项目pom.xml

Xml代码   收藏代码
  1. <build>  
  2.     <plugins>  
  3.         <plugin>  
  4.             <groupId>org.apache.maven.pluginsgroupId>  
  5.             <artifactId>maven-compiler-pluginartifactId>  
  6.             <version>2.0.2version>  
  7.             <configuration>  
  8.                 <source>1.6source>  
  9.                 <target>1.6target>  
  10.             configuration>  
  11.         plugin>  
  12.     plugins>  
  13. build>  

 

你可能感兴趣的:(Maven与Gradle)