解决 intelliJ idea maven 项目 target bytecode version 自动变化的问题

maven编译项目不会按照系统环境变量JAVA_HOME对应的版本编译,而是默认代码版本为java 5(或者 6),需要在pom.xml中配置如下

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <source>11</source>
                    <target>11</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

 

posted on 2021-02-08 22:37  及途又八  阅读(1427)  评论(0)    收藏  举报

导航