maven项目的source编译在pom文件里的设置

参考 https://www.cnblogs.com/boris-et/p/11098886.htm

写在 dependencies 之前。

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

 

 

或者直接在properties中指定

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

 

 
posted on 2019-10-21 22:27  wuyicode  阅读(5134)  评论(0编辑  收藏  举报