Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot add a repository #457

Closed
ivlis opened this issue Nov 15, 2019 · 1 comment
Closed

Cannot add a repository #457

ivlis opened this issue Nov 15, 2019 · 1 comment
Labels
doc

Comments

@ivlis
Copy link

@ivlis ivlis commented Nov 15, 2019

From the docs (https://almond.sh/docs/api-ammonite):

interp.repositories() ++= Seq(MavenRepository(
  "https://nexus.corp.com/content/repositories/releases",
  authentication = Some(Authentication("user", "pass"))
))

This fails with

cmd6.sc:1: value ++= is not a member of List[coursierapi.Repository]
  Expression does not convert to assignment because:
    not found: value MavenRepository
    not found: value authentication
    expansion: {
  <synthetic> val ev$1: ammonite.util.Ref[List[coursierapi.Repository]] = ammonite.interp.api.InterpBridge.value.repositories;
  ev$1.update(ev$1.apply().++(Seq(<MavenRepository: error>("https://nexus.corp.com/content/repositories/releases", <authentication: error> = Some(Authentication("user", "pass"))))))
}
val res6 = interp.repositories() ++= Seq(MavenRepository(
                                 ^Compilation Failed
Compilation Failed

Importing from coursier:

import coursier.MavenRepository

fails as well

cmd6.sc:128: object MavenRepository is not a member of package coursier
possible cause: maybe a semicolon is missing before `object MavenRepository'?
import coursier.MavenRepository
       ^Compilation Failed
Compilation Failed

What am I missing?

@sbrunk

This comment has been minimized.

Copy link
Member

@sbrunk sbrunk commented Nov 26, 2019

@ivlis the cursier API has changed and it's not reflected in the docs yet. The following should work:

import coursierapi.Credentials
import coursierapi.MavenRepository

interp.repositories() ++= Seq(
  MavenRepository.of("https://nexus.corp.com/content/repositories/releases")
    .withCredentials(Credentials.of("user", "pass"))
)
@sbrunk sbrunk added the doc label Nov 26, 2019
sbrunk added a commit to sbrunk/almond that referenced this issue Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.