I have a sbt project that depends on a maven project.
Is it possible to make that maven project into a sub-module of sbt project, and build that maven project together as a part of SBT build?
Resolvers. Not all packages live on the same server; sbt uses the standard Maven2 repository by default. If your dependency isn't on one of the default repositories, you'll have to add a resolver to help Ivy find it.
Yes, sbt is recommended for people starting out with Scala, it's the tool used in almost every Scala project, so it's good to get familiar with it. Same, I've used projects with both. Using maven feels like stepping in a time machine and going backwards. SBT is way better.
Once you familiarize yourself with how one Maven project builds you automatically know how all Maven projects build saving you immense amounts of time when trying to navigate many projects. On the other hand, SBT is detailed as "An open-source build tool for Scala and Java projects".
Try to add to your maven project build.sbt:
name := "mavenDep"
scalaVersion in Global := "2.10.2"
externalPom()
See Sbt documentation: Maven pom (dependencies only) externalPom does not add maven repositories - just dependencies.
So you have to add manually other repositories:
resolvers in Global ++= Seq(
"snapshots" at "http://oss.sonatype.org/content/repositories/snapshots",
"releases" at "http://oss.sonatype.org/content/repositories/releases"
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With