scala 版本兼容性问题:org.json4s:json4s-jackson_2.11:3.5.3 requires scala version: 2.11.

2023-09-26 11:29:40 浏览数 (1)

具体答案可参考github:https://github.com/scala/scala-module-dependency-sample/

原因分析:

scala-xml、scala-parser-combinators、scala-swing三种库自2.11版本后被隔离出来,基于Maven打包方式修改pom.xml的文件如下:

代码语言:javascript复制
<dependency>
  <groupId>org.scala-lang.modules</groupId>
  <artifactId>scala-xml_${scala.compat.version}</artifactId>
  <version>1.1.1</version>
</dependency>
<dependency>
  <groupId>org.scala-lang.modules</groupId>
  <artifactId>scala-parser-combinators_${scala.compat.version}</artifactId>
  <version>1.1.1</version>
</dependency>
<dependency>
  <groupId>org.scala-lang.modules</groupId>
  <artifactId>scala-swing_${scala.compat.version}</artifactId>
  <version>2.0.3</version>
</dependency>

0 人点赞