maven 添加支持编译jdk1.7

时间:2022-06-10 21:05:58
 1.在<profiles>元素内增加如下内容
   <profile>
    <id>jdk17</id>
    <activation>
    <activeByDefault>true</activeByDefault>
    <jdk>1.7<maven 添加支持编译jdk1.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>

2.在<activeProfiles> 元素内增加<activeProfile>jdk17</activeProfile>