解决Maven创建总是jdk1.5的问题

找到Maven的配置文件

  • 在解压Maven文件的conf之下
  • 打开settings.xml
  • 找到profiles这个标签,在这个标签里面找添加下面的代码
<profile>  
	<id>jdk-1.8</id>  
	<activation>  
		<activeByDefault>true</activeByDefault>  
			<jdk>1.8</jdk>  
	</activation>  
	<properties>  
		<maven.compiler.source>1.8</maven.compiler.source>  
		<maven.compiler.target>1.8</maven.compiler.target>  
		<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>  
	</properties>  
</profile>

在eclipse中配置文件

  • 如果不进行配置,eclipse中Maven的配置文件是默认指向Administrator下的.m2
  • 配置文件的路径,就是你刚刚修改的文件的路径
    在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_43642812/article/details/84962182