zoukankan      html  css  js  c++  java
  • Maven

    一、问题

    ● 创建 maven 项目的时候,jdk 版本是 1.5 版本,而自己安装的是 1.8 版本,从而导致无法使用 Java8 的新功能。

    ● 每次 右键项目名 -> maven -> update project 时候,项目 jdk 版本就会变回 1.5 版本。

    二、解决办法

    1)项目级配置:在项目中的pom.xml指定jdk版本 - 只保证当前项目

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
    </build>

    2)Maven全局配置:修改maven安装目录下的settings.xml文件,profiles标签添加:

    <profile>    
        <id>jdk-1.8</id>    
         <activation>    
            <activeByDefault>true</activeByDefault>    
            <jdk>1.8</jdk>    
          </activation>    
        <properties>    
            <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>
  • 相关阅读:
    优化总结文章链接
    帧同步、状态同步
    ecs
    AStarPathFinding
    unity 热更方案对比
    C#数据类型
    JavaScript基础
    CSS中margin和padding的区别
    css选择器
    hadoop中使用shell判断HDFS文件是否存在
  • 原文地址:https://www.cnblogs.com/Dm920/p/12502723.html
Copyright © 2011-2022 走看看