maven jdk版本设置

方法1 通过profile设置

修改${M2_HOME}/conf/settings.xml或${HOME}/.m2/settings.xml

增加或修改profile

<profile>
    <id>dev</id>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.6</maven.compiler.source>
        <maven.compiler.target>1.6</maven.compiler.target>
        <maven.compiler.compilerVersion>1.6</maven.compiler.compilerVersion>
    </properties>
    <activation>
        <activeByDefault>true</activeByDefault>
    </activation>
</profile>
方法2 修改项目pom

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

你可能感兴趣的:(jdk,maven,compiler)