Search code examples
scalamavensbtartifactory

Sbt - Specify dependency extension


i have troubles with Sbt. In my local instance of JFrog Artifactory i have published a java library without the .pom file, so i have just the .jar file.

Configuration:

//build.sbt 
libraryDependencies += "com.example" % "my-library" % "1.0" % "provided"


//build.properties
sbt.version = 1.3.0-RC2

Obliviously i have configured the resolvers properly.


Sbt fails with the following error:

not found: http://[Artifactory]/artifactory/maven/com/example/my-library/1.0/my-library-1.0.pom

The error is clear, indeed .pom file doesn't exists.

There is a way to specify, for a specific dependency, the extension ?


Solution

  • If for whatever reason you published the jar without a pom file on purpose, you can specify an explicit URL for the jar you want to depend on, e.g.

    libraryDependencies += "slinky" % "slinky" % "2.1" 
      from "https://slinky2.googlecode.com/svn/artifacts/2.1/slinky.jar"
    

    But if you just published the library ivy-style (so an ivy.xml file was published instead of a pom file), you just need to specify a right resolver for your repository, which will have ivy-style patterns.