Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add some local maven repo url to global sbt, and make them be tried first?

I want to add some fast local maven repository url to sbt, say:

http://maven.example.com/public

I want to add it to "global", so that I don't need to add them to each of sbt project. And also want to be tried first when sbt downloading some jars.

But I can't find useful information to do this, how to do it?

(My sbt version is 0.13.1)

like image 212
Freewind Avatar asked Jan 17 '26 10:01

Freewind


1 Answers

With the help of a friend, finally I found the solution:

  1. create a new file ~/.sbt/repositories

  2. add content like this:

    [repositories]
    local
    my-maven-repo: http://example.org/repo
    my-ivy-repo: http://example.org/ivy-repo/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext]
    

See official doc: http://www.scala-sbt.org/0.13.2/docs/Detailed-Topics/Library-Management.html#override-all-resolvers-for-all-builds

like image 171
Freewind Avatar answered Jan 20 '26 02:01

Freewind



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!