How to Fix a basic import error? #1650
-
Hey There, I'm fairly new to Scala and build tools. For a side project I wanted to import a Java Package created by Google. But I keep getting an import error: I have the project working in an SBT-project, but I can't stomach that it doesn't work in Mill. What am I doing wrong? P.S. I am using VS Code with Metals and the project is based on 'example-3' this one Best, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I'm just quoting your // build.sc
import mill._, scalalib._
object GtmAudit extends ScalaModule{
def scalaVersion = "2.13.7"
object test extends Tests{
def ivyDeps = Agg(ivy"com.lihaoyi::utest:0.7.10",
ivy"com.google.api-client:google-api-client:1.31.5")
def testFrameworks = Seq("utest.runner.Framework")
}
} You only defined the google library as dependency of the // build.sc
import mill._, scalalib._
object GtmAudit extends ScalaModule{
def scalaVersion = "2.13.7"
def ivyDeps = Agg(ivy"com.google.api-client:google-api-client:1.31.5")
object test extends Tests{
def ivyDeps = Agg(ivy"com.lihaoyi::utest:0.7.10")
def testFrameworks = Seq("utest.runner.Framework")
}
} |
Beta Was this translation helpful? Give feedback.
I'm just quoting your
build.sc
for context:You only defined the google library as dependency of the
GtmAudit.test
module, whereas you also want it to use inGtmAudit
module.You need to move the dependency from the test module to the core module.