一劳永逸_修改maven 默认使用的JDK

来源:互联网 发布:金十数据 更新 编辑:程序博客网 时间:2024/05/04 02:14

在settings.xml中,找到 <profiles></profiles>标签,在内部添加如下代码:(下面以JDK1.7为例)

  <profile>    <id>jdk-1.7</id>    <activation>        <activeByDefault>true</activeByDefault>        <jdk>1.7</jdk>    </activation>    <properties>        <maven.compiler.source>1.7</maven.compiler.source>        <maven.compiler.target>1.7</maven.compiler.target>        <maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>    </properties> </profile>
再在项目上名上点击右键-->maven-->update project




0 0
原创粉丝点击