build scala项目时出现:org.jetbrains.jps.incremental.scala.remote.ServerException

本文探讨了在使用Maven构建Scala项目时遇到的StackOverflowError问题,分析了可能的原因,包括JDK与Scala版本冲突、代码中递归过深及case class字段过多等问题,并提供了排查和解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

build项目时出现:org.jetbrains.jps.incremental.scala.remote.ServerException

或者打包时出现以下情况:

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building bdjob 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ bdjob ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] 
[INFO] --- scala-maven-plugin:3.2.2:add-source (scala-compile-first) @ bdjob ---
[INFO] Add Source directory: E:\workspace\xxx\src\main\scala
[INFO] Add Test Source directory: E:\workspace\xxx\src\test\scala
[INFO] 
[INFO] --- scala-maven-plugin:3.2.2:compile (scala-compile-first) @ bdjob ---
[WARNING]  Expected all dependencies to require Scala version: 2.11.0
[WARNING]  com.twitter:chill_2.11:0.8.4 requires scala version: 2.11.8
[WARNING] Multiple versions of scala libraries detected!
[INFO] E:\workspace\xxx\src\main\java:-1: info: compiling
[INFO] E:\workspace\xxx\src\main\scala:-1: info: compiling
[INFO] Compiling 10 source files to E:\workspace\xxx\target\classes at 1571638690784
[ERROR] error: java.lang.StackOverflowError
[INFO] 	at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5293)
[INFO] 	at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typers.scala:5330)

可以从以下几个方面进行考虑:

  1. jdk与scala版本是否冲突
  2. 代码中是否存在递归过深的情况
  3. case class的字段是否过多
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值