How do I publish an Ivy Dependency via SBT?

ivy, maven, sbt, scala

Solution

To publish Ivy style, as opposed to Maven, you should enable the following setting in your build:

publishMavenStyle := false

`Resolver.ivyStylePatterns` doesn't govern the publishing style (which artifacts to generate, etc.) It only specifies the repository paths structure, which are different between Ivy and Maven.

Problem

I am trying to use SFTP to publish a dependency to another server: ``` publishTo := Some( Resolver.sftp(name, host, "/home/user/.ivy2/local")(Resolver.ivyStylePatterns) ) ``` This works as expected and it publishes to the remote server, but it doesn't create a "ivys" directory, only a "poms" directory. This leads Coursier (what I'm using on that machine to resolve dependencies) to be unable to resolve the dependency because it can't find "ivys/ivy.xml". Any assistance would be greatly appreciated.

Original source