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

Comments

Projects
None yet
2 participants
@dwijnand
Copy link
Member

dwijnand commented Mar 15, 2018

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

This comment has been minimized.

Copy link
Member Author

dwijnand commented Mar 19, 2018

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

@eed3si9n

This comment has been minimized.

Copy link
Member

eed3si9n commented Mar 19, 2018

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

This comment has been minimized.

Copy link
Member Author

dwijnand commented Mar 19, 2018

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

This comment has been minimized.

Copy link
Member

eed3si9n commented Mar 19, 2018

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

This comment has been minimized.

Copy link
Member Author

dwijnand commented Mar 19, 2018

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

This comment has been minimized.

Copy link
Member

eed3si9n commented Mar 19, 2018

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

This comment has been minimized.

Copy link
Member Author

dwijnand commented Mar 19, 2018

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

This comment has been minimized.

Copy link
Member

eed3si9n commented Mar 19, 2018

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

@dwijnand dwijnand closed this Sep 3, 2018

@yash-lf yash-lf referenced this issue Dec 5, 2018

Closed

SBT | how to disable or avoid .sbt/preloaded #4477

1 of 1 task complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.