0

I have projects implemented on scala/sbt and java/maven. Both use dependency someDependecy.jar which is hosted in artifactory.

To resolve path to artifactory for maven I've just added settings.xml into HOME/.m2.

Can I somehow tell sbt to use settings.xml to not to duplicate this urls and credentials to artifactory?

Bohdan Myslyvchuk
  • 1,657
  • 3
  • 24
  • 39

3 Answers3

2

I'd just add the artifactory location as a resolver into your build.sbt

resolvers += "my-artifactory" at "https://artifactory.host/groups/public"
libraryDependencies ++= Seq(
   "com.me" % "custom-dependency" % "1.0-SNAPSHOT", 
   "junit" % "junit" % "4.12" % "test"
)
1

Look like XY; Rather than looking for a way to make SBT read maven specific config, it could recommended to check how to make it behave in similar way, like using dependency resolver.

cchantep
  • 9,118
  • 3
  • 30
  • 41
1

Basically, if you want to resolve dependencies with sbt it uses under the hood ivy for dependency resolution. You cannot use settings.xml from maven. For sbt you need to specify ~/.sbt/repository and ~/.sbt/.credentials files to point to some dependency storage as JFrog as ir was mentioned here .

Bohdan Myslyvchuk
  • 1,657
  • 3
  • 24
  • 39