最近脑子都不好使...都是做下记录的,万一我那天失忆了.应该能找得到
maven配置jdk的两种方法..
- 设置全局的jdk
- 设置局部的jdk
设置全局的jdk,在setting.xml文件中的profiles元素下添加
<profile> <id>jdk17</id> <activation> <activeByDefault>true</activeByDefault> <jdk>1.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>
设置局部的jdk,在项目的pom,xml文件中添加
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> </plugins> </build>