Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin(自测问题解决!)

在使用maven进行springboot项目打包时,报了Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project education: Fatal error compiling。搜了很多种方式,后来发现是maven里面指定的jdk版本冲突。下面是解决办法。

1.查看springboot项目中指定的jdk版本

2.查看这个项目使用的maven配置文件的位置

3.打开改settings文件,修改为springboot项目指定的jdk版本保存即可

也可以直接在pom文件中引入jdk版本即可

csharp 复制代码
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>${java.version}</source>
                <target>${java.version}</target>
            </configuration>
        </plugin>
    </plugins>
</build>
相关推荐
会编程的吕洞宾19 小时前
Spring AI 2.0 工具调用实战:让 AI 自动调用你的 Java 方法
java·人工智能·经验分享·后端·spring
斯维赤19 小时前
SELECT * 为什么是覆盖索引的天敌?
java·后端·mysql
stormsha20 小时前
库存 5,10 个并发各买 1 件:为什么最后不剩 -5 件
java·数据库·mysql
RobinXYuan20 小时前
【Java 字节码探秘】02 ClassFile 骨架:十个字段
java·jvm·源码阅读
炸薯条!20 小时前
Python面向对象基础:类与对象、实例方法、魔法方法和属性详解
java·开发语言·python
SimonKing21 小时前
又一款数据库同步神器,2.3K Star的dbswitch
java·后端·程序员
CoderYanger1 天前
Java EE 进阶:11. SpringBoot 统一功能处理(第二弹):DispatcherServlet 源码分析+适配器模式
java·数据库·hive·spring boot·面试·java-ee·mybatis
Rain的Java大神之路1 天前
前端转 Java 全栈:用 AI 两天交付一个能跑的 Demo,踩坑全记录
java·前端·后端
蜡笔小谢1 天前
DeepSeek Harness Java 实战笔记(五)|插件、MCP 与 Skill
java·笔记·ai·agent·deepseek·harness
唐老板1 天前
Spring AI 2.0 只支持 Boot 4
java