问题:mvn package时出现Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1
1. 问题:
- 打包springboot多模块时,出现的问题 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1
- 我的项目结构如下
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/414212c604ada5a4eada02bbdb752d0f.png#pic_center)
2. 解决,pom中如下配置maven插件,配置中声明使用JDK1.8,因为我的项目是jdk1.8的,所以设置成1.8的
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</build>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</build>