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 resolve sbt plugin from local ivy repository #4015

Closed
jastice opened this issue Mar 15, 2018 · 6 comments
Closed

Cannot resolve sbt plugin from local ivy repository #4015

jastice opened this issue Mar 15, 2018 · 6 comments
Labels
area/library_management library management Blocked on Upstream uncategorized Used for Waffle integration

Comments

@jastice
Copy link
Contributor

jastice commented Mar 15, 2018

steps

I am trying to publish an sbt plugin to a local file repo. In the plugin's build.sbt I have:

publishTo := Some(Resolver.file("localtrix", file("/Users/jast/repo/localtrix")))

I run the publish task and it gets published fine to
/Users/jast/repo/localtrix/org/me/sbt-plugin_2.12_1.0/1.2.3

In another project, I want to resolve this plugin. in project/plugins.sbt I have:

resolvers += Resolver.file("localtrix", file("/Users/jast/repo/localtrix"))
addSbtPlugin("org.me" % "sbt-plugin" % "1.2.3")

problem

I try to run sbt in the this project and I get:

[info] Updating ProjectRef(uri("file:/Users/jast/playspace/untitled38/project/"), "untitled38-build")...
[warn] 	module not found: org.me#sbt-plugin;1.2.3
[warn] ==== typesafe-ivy-releases: tried
[warn]   https://repo.typesafe.com/typesafe/ivy-releases/org.me/sbt-plugin/scala_2.12/sbt_1.0/1.2.3/ivys/ivy.xml
[warn] ==== sbt-plugin-releases: tried
[warn]   https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/org.me/sbt-plugin/scala_2.12/sbt_1.0/1.2.3/ivys/ivy.xml/2017.2+4-3037ba82+20180314-1919/ivys/ivy.xml
[warn] ==== local: tried
[warn]   /Users/jast/.ivy2/local/org.me/sbt-plugin/scala_2.12/sbt_1.0/1.2.3/ivys/ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/org/me/sbt-plugin_2.12_1.0/1.2.3/sbt-plugin-1.2.3.pom
[warn] ==== local-preloaded-ivy: tried
[warn]   /Users/jast/.sbt/preloaded/org.me/sbt-plugin/scala_2.12/sbt_1.0/1.2.3/ivys/ivy.xml
[warn] ==== local-preloaded: tried
[warn]   file:////Users/jast/.sbt/preloaded/org/me/sbt-plugin_2.12_1.0/1.2.3/sbt-plugin-1.2.3.pom
[warn] ==== localtrix: tried
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 	::          UNRESOLVED DEPENDENCIES         ::
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::
[warn] 	:: org.me#sbt-plugin;1.2.3: not found
[warn] 	::::::::::::::::::::::::::::::::::::::::::::::

The sbt plugin fails to resolve. Of note: it reports localtrix: tried but does not actually report the url it tried.

Relevant code in ivy's reporter: https://github.com/sbt/ivy/blob/2.3.x-sbt/src/java/org/apache/ivy/plugins/resolver/BasicResolver.java#L796-L800

expectation

The sbt plugin resolves

notes

sbt version: insert sbt version

@dwijnand dwijnand added the area/library_management library management label Mar 15, 2018
@dwijnand
Copy link
Member

perhaps it works if you publish and resolve from a local file ivy repository?

@jastice
Copy link
Contributor Author

jastice commented Mar 16, 2018

What worked:
in plugin: publishMavenstyle := true
in project: `resolvers += "localtrix" at "file:///Users/jast/repo/localtrix"

@dwijnand
Copy link
Member

(semi-related sbt/librarymanagement#224)

@jastice
Copy link
Contributor Author

jastice commented Mar 19, 2018

Furthermore, publishing and resolving with explicit Resolver.ivyStylePatterns works:

publishTo := Some(Resolver.file("localtrix", file("/Users/jast/repo/localtrix"))(Resolver.ivyStylePatterns))
resolvers += Resolver.file("localtrix", file("/Users/jast/repo/localtrix"))(Resolver.ivyStylePatterns)

@dwijnand
Copy link
Member

dwijnand commented Mar 19, 2018

so this is exactly sbt/librarymanagement#224

if you publish maven style (which is the default) then Resolver.file doesn't work but "localtrix" at "file:///.." (aka MavenRepository) does.

@eed3si9n
Copy link
Member

eed3si9n commented Aug 9, 2019

if you publish maven style (which is the default) then Resolver.file doesn't work but "localtrix" at "file:///.." (aka `MavenRepository) does.

ok so I am closing this.

@eed3si9n eed3si9n closed this as completed Aug 9, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/library_management library management Blocked on Upstream uncategorized Used for Waffle integration
Projects
None yet
Development

No branches or pull requests

3 participants