Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Allow to use http repository from repostories file

Tags:

sbt

I've updated to SBT 1.3.0. Now I keep receiving warning on every action:

[warn] insecure HTTP request is deprecated 'http://<company_domain>/nexus/content/repositories/mvnrepository/'; switch to HTTPS or opt-in as ("nexus" at "http://<company_domain>/nexus/content/repositories/mvnrepository/").withAllowInsecureProtocol(true)

I've tried following options in ~/.sbt/repositories file:

nexus: ("http://<company_domain>/nexus/content/repositories/mvnrepository/").withAllowInsecureProtocol(true)

and

("nexus" at "http://<company_domain>/nexus/content/repositories/mvnrepository/").withAllowInsecureProtocol(true)

How can I allow http repositories globally (for all configured repositories)?

like image 473
SathOkh Avatar asked Sep 13 '19 13:09

SathOkh


2 Answers

create ~/.sbt/resolvers.sbt and add there

resolvers += ("nexus" at "http://<company_domain>/nexus/content/repositories/mvnrepository/").withAllowInsecureProtocol(true)

or

resolvers ++= Seq(
  ("nexus" at "http://<company_domain>/nexus/content/repositories/mvnrepository/").withAllowInsecureProtocol(true),
  ("nexus" at "http://<company_domain>/nexus/content/repositories/mvnrepository/").withAllowInsecureProtocol(true),
...
)
like image 192
Dmitry Gorsky Avatar answered Oct 24 '22 04:10

Dmitry Gorsky


in your .sbt/repositories file, you can add setting using comma:

[repositories]
  nexus: http://<company_domain>/nexus/content/repositories/mvnrepository/, allowInsecureProtocol

look at pattern in sbt documentation:

name: url(, pattern)(,bootOnly)(,descriptorOptional)(,skipConsistencyCheck)(,allowInsecureProtocol)
like image 30
Boris Azanov Avatar answered Oct 24 '22 03:10

Boris Azanov