Package not found tho it's there (I think)

Hi.
I have a play project. I ran into this compile error:

[info] Compiling 1 Java source to /home/laca/play/play-scala-seed/target/scala-2.12/classes ...
[error] /home/laca/play/play-scala-seed/app/client/SajatDriver.java:13:1: package org.openqa.selenium.htmlunit does not exist
[error] import org.openqa.selenium.htmlunit.HtmlUnitDriver;

…while I have the htmlunit-driver-2.33.3.jar file that contains it, under ~/.ivy2/cache/org.seleniumhq.selenium/htmlunit-driver/jars . AFAIK, then it should find it.
Eclipse knows about it (since i eclipsified the project with that sbt plugin), and it does not complain against this import (even it was that who offered it).
Isn’t there a purge command in sbt? I don’t dare to delete the whole .ivy2 .
Thanks
Laca

Hey @L-a-c-a,

No. ~/.ivy2/cache is a cache used to not needing to resolve (including download) the same dependency jars over and over again. Having a jar inside this cache does not mean it will be automatically included in your project.

You need to explicitly add the dependency to your project, as explained here:

https://www.scala-sbt.org/1.x/docs/Library-Dependencies.html#Managed+Dependencies

Best.

Thanks.
In my case,

libraryDependencies += "org.seleniumhq.selenium" % "htmlunit-driver" % "latest.integration"

did the trick.
Obrigado,
Laca