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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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")
回答2:
You could also try this:
https://github.com/sbt/sbt-pom-reader
For limited sets of maven projects (i.e. ones that don't use plugins) it can pull in information from maven into sbt in a slightly better way. However, mapping maven plugins into sbt is practically a failed task.