如果你用eclipse建立maven项目时,新建的项目往往JDK版本很低——1.5!怎么办?修改settings.xml文件,增加profile节点,如下所示:
- <profile>
- <id>jdk-1.6</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- <jdk>1.6</jdk>
- </activation>
- <properties>
- <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>
- </profile>