IDEA问题笔记_Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile

  • 问题描述:

使用idea打包命令package时报错:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile…

  • 解决方法:
步骤一:在项目的pom.xml中加入以下代码
 <plugins>
 	<plugin>
		<groupId>org.springframework.bootgroupId>
		<artifactId>spring-boot-maven-pluginartifactId>
	plugin>
	<plugin>
		<groupId>org.apache.maven.pluginsgroupId>
		<artifactId>maven-compiler-pluginartifactId>
		<version>3.8.1version>
		<configuration>
			<verbose>trueverbose>
			<fork>truefork>
			<executable>${JAVA8_HOME}/bin/javacexecutable>
		configuration>
	plugin>
plugins>
步骤二:修改settings.xml文件(\apache-maven-3.6.1\conf\settings.xml)
<profiles>
	<profile>
		<id>custom1-compilerid>
		<properties><JAVA8_HOME>D:\Java\jdk8\jdk1.8.0_171JAVA8_HOME>properties>
	profile>
profiles>
<activeProfiles>
	<activeProfile>custom1-compileractiveProfile>
	<activeProfile>custom-compileractiveProfile>
activeProfiles>

完成上面步骤后,Idea会自动自成一个Profiles选项,不用管它,再次执行打包命令package即可。

IDEA问题笔记_Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile_第1张图片

你可能感兴趣的:(IDEA问题笔记,idea打包报错)