Search code examples
sbtivy

built.sbt without .repositories file with m2compatible set to true


i am in a scenario that the artifacts are published to a local maven repository with both both pom file and ivy file. I am trying to access this repository by treating it as an ivy repo, as a result, I had to set m2compatible=true so that the resolvers can correctly identify the path pattern.

sbt allows one to override the default list of resolvers through the following properties:

-Dsbt.override.build.repos=true -Dsbt.repository.config=<path to sbt repository file>

The foramt of the repository file is something like the following,

[repositories]
local
my-artifacts: http://my.artifact.proxyserver.com/artifacts/,[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]
maven : http://my.artifact.proxyserver.com/artifactory/maven-central

My question is how am I able to specify m2compatible=true for the resolver "my-artifacts" in the above file? Because without that setting, if I depend on

com.google.common % guava % 23.1

the resolver will look for the path:

com.google.common/guava/23.1 

instead of

com/google/common/guava/23.1

Solution

  • sbt allows to add mavenCompatible towards the end of an ivy resolver.