美文网首页
maven指定JDK版本

maven指定JDK版本

作者: adced06edef5 | 来源:发表于2019-10-02 08:24 被阅读0次

    全局配置,修改maven的settings.xml

    <profile>
        <id>jdk-1.8</id>
        <activation>
          <jdk>1.8</jdk>
          <activeByDefault>true</activeByDefault>
        </activation>
        <properties>
          <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
          <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
          <maven.compiler.encoding>UTF-8</maven.compiler.encoding>
          <maven.compiler.source>1.8</maven.compiler.source>
          <maven.compiler.target>1.8</maven.compiler.target>
          <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
        </properties>
    </profile>
    

    当前项目配置pom.xml

    <profile>
        <id>jdk-1.8</id>
        <activation>
          <jdk>1.8</jdk>
          <activeByDefault>true</activeByDefault>
        </activation>
        <properties>
          <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
          <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
          <maven.compiler.encoding>UTF-8</maven.compiler.encoding>
          <maven.compiler.source>1.8</maven.compiler.source>
          <maven.compiler.target>1.8</maven.compiler.target>
          <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
        </properties>
    </profile>
    

    相关文章

      网友评论

          本文标题:maven指定JDK版本

          本文链接:https://www.haomeiwen.com/subject/wrvlpctx.html