Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I want to use org.apache.commons.lang.NotImplementedException as it seems to be the only NotImplementedException 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?

like image 333
Ivan Avatar asked Oct 12 '11 19:10

Ivan


1 Answers

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.

like image 77
Ivan Avatar answered Nov 14 '22 18:11

Ivan