IDEA遇到Auto build completed with errors以及卡在parsing java...几种情况的分析

本文介绍了在IntelliJ IDEA中部署Spring Boot项目时遇到的“Autobuild completed with errors”问题及其解决办法。问题源于Maven无法正确下载依赖,通过检查并调整项目的JDK版本最终得以解决。

   在使用IDEA的时候,经常从类似git之类的地方将上面的代码clone并部署到本地。有时候配置完一些必要的东西之后,maven会根据项目配置好的pom.xml开始自动的下载依赖包,一般情况下会很顺利的安装好相关依赖的jar包然后直接点运行项目就完成部署了,具体步骤随便找一下都有。
    但是最近碰到了一个比较玄学的问题,用IDEA利用从git上clone下来一个spring-boot项目的框架时候,我照着平常的习惯,maven,install(因为是spring-boot不用tomcat)然后下载完依赖包点运行的时候发现下面控制台不断提示Auto build completed with errors然后然后install的时候一直卡在XX files to....这样的地方,但是maven projects中的依赖包是不存在红线的,也就是说依赖包被maven下完了。。当时也没想太多直接点了运行,然后它就一直卡在parsing java....这个环节不动了,起初分享给小伙伴,以为是maven默认下载使用的是apache外网访问速度慢的问题,然后在建议下换了阿里云的镜像。。。但是没有任何用,仍旧是相同的问题。

    然后开始在网上找了一下,很遗憾没有多少人遇到相同的问题,但是看到了第一种引起这个问题的情况。
一.
       由于不正确的Maven home directory配置引起的。
可以打开Settings->Build,Execution,Deployment->Build Tools->Maven里面把Maven设置为Bundled(Maven3)。
但是我的配置和这个我找到的答案一模一样,也就是说仍没有解决我的问题,然后去stackoverflow寻找了答案,在耐心看完一些英文后仍旧是一无所获。然后就去求助了大佬。在经过一些尝试与猜测后基本锁定了与java的jdk版本的问题。后来经过一些试探性的琢磨解决了这个问题。

二.由于不匹配的jdk版本引起的maven无法自动下载所需要的依赖包,
     

   步骤:先查看自己给这个项目配置的jdk版本,打开如下图所示即可看到版本。

然后再去看了这个项目的pom.xml的jdk版本
大致方法可另行查询,大概都会有注释。

如果两者版本是不一致的,这时候只需要去下载一个与pom.xml版本一致的jdk给这个项目配置上就可以了,mavaen就正常下载了依赖包并正确成功的编译了。

Executing pre-compile tasks… Running 'before' tasks Checking sources Copying resources… [soms] Dependency analysis found 0 affected files Updating dependency information… [soms] Parsing java… [soms] java: 无法找到类型 'kotlin.jvm.internal.SourceDebugExtension' 的注释方法 'value()': 找不到kotlin.jvm.internal.SourceDebugExtension的类文件 java: 无法找到类型 'kotlin.jvm.internal.SourceDebugExtension' 的注释方法 'value()' java: You aren't using a compiler supported by lombok, so lombok will not work and has been disabled. Your processor is: org.jetbrains.jps.javac.$Proxy8 Lombok supports: sun/apple javac 1.6, ECJ java: 来自注释处理程序 'org.mapstruct.ap.MappingProcessor' 的受支持 source 版本 'RELEASE_6' 低于 -source '1.8' java: 没有处理程序要使用以下任何注释: com.fasterxml.jackson.annotation.JsonProperty,org.springframework.data.repository.query.Param,org.springframework.web.bind.annotation.RequestParam,org.mapstruct.Mapping,net.sf.jasperreports.functions.annotations.FunctionCategory,org.springframework.beans.factory.annotation.Autowired,javax.validation.constraints.NotEmpty,javax.validation.Valid,org.apache.ibatis.type.MappedJdbcTypes,org.springframework.stereotype.Repository,org.springframework.web.bind.annotation.PostMapping,javax.annotation.Resource,javax.validation.constraints.Pattern.List,javax.validation.constraints.NotNull,org.springframework.web.bind.annotation.RestController,com.huawei.it.jalor5.core.annotation.JalorResource,io.swagger.v3.oas.annotations.tags.Tag,org.springframework.context.annotation.Lazy,io.swagger.v3.oas.annotations.responses.ApiResponses,com.alibaba.fastjson.annotation.JSONField,org.springframework.scheduling.annotation.EnableAsync,org.springframework.context.annotation.PropertySource,org.springframework.boot.context.properties.ConfigurationProperties,org.springframework.scheduling.annotation.Scheduled,org.springframework.context.annotation.Scope,org.springframework.web.bind.annotation.RequestBody,org.springframework.beans.factory.annotation.Value,io.swagger.v3.oas.annotations.Operation,org.springframework.stereotype.Service,org.springframework.web.bind.annotation.ExceptionHandler,javax.inject.Named,org.springframework.scheduling.annotation.EnableScheduling,javax.annotation.Nullable,org.springframework.web.bind.annotation.ControllerAdvice,org.springframework.validation.annotation.Validated,org.apache.ibatis.annotations.Param,org.springframework.boot.autoconfigure.SpringBootApplication,javax.xml.bind.annotation.XmlRootElement,org.apache.ibatis.type.Alias,com.huawei.it.jalor5.core.annotation.NoJalorTransation,com.huawei.it.jalor5.core.annotation.JalorOperation,org.apache.logging.log4j.core.config.plugins.validation.constraints.NotBlank,com.huawei.it.isrp.common.config.retry.Retryable,org.springframework.web.bind.annotation.PathVariable,javax.validation.constraints.Size,javax.validation.constraints.Min.List,org.springframework.web.bind.annotation.PutMapping,org.mapstruct.Mapper,com.fasterxml.jackson.annotation.JsonAlias,javax.ws.rs.DefaultValue,javax.validation.constraints.Max,org.apache.ibatis.annotations.MapKey,org.springframework.data.annotation.Transient,org.springframework.web.bind.annotation.DeleteMapping,io.swagger.v3.oas.annotations.media.Schema,javax.validation.constraints.Min,org.apache.ibatis.type.MappedTypes,com.fasterxml.jackson.annotation.JsonFormat,com.google.gson.annotations.SerializedName,io.swagger.v3.oas.annotations.Parameter,org.springframework.context.annotation.Configuration,org.jetbrains.annotations.Nullable,javax.validation.constraints.Pattern,org.apache.ibatis.annotations.Mapper,javax.annotation.PostConstruct,org.springframework.web.bind.annotation.RequestHeader,org.jetbrains.annotations.NotNull,org.hibernate.validator.constraints.Length,org.springframework.scheduling.annotation.Async,org.mapstruct.Mappings,javax.validation.constraints.NotBlank,javax.validation.constraints.Size.List,org.springframework.web.bind.annotation.RequestMapping,javax.validation.constraints.DecimalMin,org.hibernate.validator.constraints.Range,java.lang.FunctionalInterface,javax.inject.Inject,net.sf.jasperreports.functions.annotations.FunctionCategories,com.fasterxml.jackson.annotation.JsonIgnore,org.springframework.beans.factory.annotation.Qualifier,org.springframework.web.bind.annotation.GetMapping,net.sf.jasperreports.functions.annotations.Function,org.springframework.web.bind.annotation.ResponseBody,net.sf.jasperreports.functions.annotations.FunctionParameters,org.springframework.stereotype.Component,javax.validation.constraints.DecimalMax,com.fasterxml.jackson.annotation.JsonInclude,org.springframework.context.annotation.Bean,com.google.common.annotations.VisibleForTesting,org.springframework.transaction.annotation.Transactional Dependency analysis found 0 affected files Errors occurred while compiling module 'soms' javac 8 was used to compile java sources Finished, saving caches… Compilation failed: errors: 1; warnings: 17 Executing post-compile tasks… Synchronizing output directories… 2025/8/7 15:16 - Build completed with 1 error and 9 warnings in 6 sec, 749 ms 使用中文给出解决方案
08-08
评论 3
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值