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

Difference between Resolver.url & "foo" at "https://.." #224

Closed
dwijnand opened this issue Mar 15, 2018 · 8 comments
Closed

Difference between Resolver.url & "foo" at "https://.." #224

dwijnand opened this issue Mar 15, 2018 · 8 comments
Labels

Comments

@dwijnand
Copy link
Member

I was reminded to today by @SethTisue of this issue which doesn't seem to have been already reported: there's a different between

Resolver.url("foo", new URL("http://example.org/foo/"))(Resolver.mavenStylePatterns)

and

"foo" at "https://example.org/foo/"
@dwijnand
Copy link
Member Author

same with Resolver.file and "foo" at "file://.." (see sbt/sbt#4015)

@eed3si9n
Copy link
Member

How is this a bug? The documentation (https://www.scala-sbt.org/1.x/docs/Resolvers.html) says:

Maven

Resolvers for Maven2 repositories are added as follows:

resolvers += 
 "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"

@dwijnand
Copy link
Member Author

how is it not a bug? in both cases you're trying to define a resolver for a maven repository. why does one work and the other not?

also note that the very same page you link says:

These are basic examples that use the default Maven-style repository layout.
[...]

URL

Define a URL repository at "https://example.org/repo-releases/".

resolvers += Resolver.url("my-test-repo", url("https://example.org/repo-releases/"))

(https://www.scala-sbt.org/1.x/docs/Resolvers.html#URL)

@eed3si9n
Copy link
Member

Resolver.url defines an Ivy repository. Maven repos are statically different type - https://github.com/sbt/librarymanagement/blob/1.x/core/src/main/contraband-scala/sbt/librarymanagement/MavenRepository.scala

@dwijnand
Copy link
Member Author

Resolver.url defines an Ivy repository.

where is that stated?

the type signature states it defines a URL repository. it accepts patterns of which there is a mavenStylePatterns, which also the defaultPatterns and the implicit Patterns value in implicit scope.

@eed3si9n
Copy link
Member

Custom

sbt provides an interface to the repository types available in Ivy: file, URL, SSH, and SFTP.

There's more to Maven emulation than layout internal to both sbt and Ivy.

@dwijnand
Copy link
Member Author

There's more to Maven emulation than layout internal to both sbt and Ivy.

where is that stated?

this is way to easy to do wrong and the fact that it's wrong is not obvious.

@eed3si9n
Copy link
Member

Not sure if these implementation details are stated but there are things like sbt/sbt#2172 and more stuff on the Ivy side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants