开发者

Why can't Scala find org.apache.commons.lang package?

开发者 https://www.devze.com 2023-04-12 09:44 出处:网络
I want to use org.apache.commons.lang.NotImplementedException as it seems to be the only NotImple开发者_如何学运维mentedException implementation in Java/Scala domain. I can remember I used to use it w

I want to use org.apache.commons.lang.NotImplementedException as it seems to be the only NotImple开发者_如何学运维mentedException implementation in Java/Scala domain. I can remember I used to use it with Scala 2.8.1 with no hacks. But now it says "object lang is not a member of package org.apache.commons". Where has org.apache.commons.lang gone?


I've just found the answer myself. The problem is Apache Commons 3 no longer include lang (including lang3 instead, which is differend and doesn't contain NotImplementedException), so we need Apache Commons 2.6. And what's inobvious here is that the Maven group id for it is not org.apache.commons, but commons-lang - the same as its artifact id.

So I had to add "commons-lang" % "commons-lang" % "2.6" dependency and do sbt update to make it work.

0

精彩评论

暂无评论...
验证码 换一张
取 消