-
Notifications
You must be signed in to change notification settings - Fork 39
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
Dynamic Revisions with Ivy #6
Comments
I haven't figured out for certain if/where ApacheURLLister is used, but its presence suggests that Ivy is expecting an HTML directory listing to resolve dynamic revisions: |
Yeah I was thinking the same thing after seeing that ApacheURLLister class. I'll take a look tomorrow and see if I can confirm it is expecting an Apache style directory listing. If that's the case then it seems like it would be pretty easy to add that functionality. |
I did some digging into this and so far don't see an obvious way to add the dynamic revisions functionality. Here is what I've found:
There is also a I turned on logging of the calls in my
Now that might just be because there is something higher up in Ivy that should be handling the dynamic revisions but since it doesn't work for Next StepsDigging around the code some more I think a possible solution might be to create a new class that extends I don't have any more time to mess around with it today (and possibly not this week) but can circle back to this issue when I have some more time. In the meanwhile if you want to play around with it I'd happily except a pull request or even just prototype or proof of concept code that I can clean up or model a solution after. |
Are you familiar with https://github.com/ohnosequences/sbt-s3-resolver? I chose fm-sbt-s3-resolver over sbt-s3-resolver because I liked the optional path feature and how it's configured (simple!). It turns out that sbt-s3-resolver has implemented a Ivy repository (similar to your proposed next steps). I opened an issue against sbt-s3-resolver because it also has an issue with dynamic revisions (ohnosequences/sbt-s3-resolver#31). |
I ended up submitting a patch to https://github.com/ohnosequences/sbt-s3-resolver because it already implements a resolver (vs. a protocol handler). However, I ended up putting this together: https://github.com/munchii/sbt-s3-resolver (it lacks an optional path feature at the moment, but publishes an Apache-style directory listing so a static website hosted with S3 is browsable and works with dynamic revisions). |
I'm going to leave this open for now since I would still like to add support for dynamic revisions when I have time. I spent a little bit of time digging through the Ivy & SBT source code but haven't found the right place to hook in an updated repository/resolver in such a way that keeps the existing SBT configuration syntax. I'm glad you found a solution that works for you. I am familiar with https://github.com/ohnosequences/sbt-s3-resolver. I started off using that plugin but had a few issues with it:
|
I spent some more time on this and got it mostly* working. I tried really hard to make it work with the existing syntax but just couldn't find a way given how IVY and SBT are setup. Here is what I ended up with (in the current 0.5.0-SNAPSHOT):
|
Slight update on syntax. The
See commit cc9f1b5 |
@tpunder While you've noted that this is implemented, I'm not sure it was ever released, since it doesn't currently resolve (version 0.16.0). Also, thank you for making this plugin - it's super useful! |
Hi @omervk, nothing new to report since the last update on this issue (almost 4 years ago!). Is the resolvers += "FrugalMechanic Snapshots" atS3 "s3://maven.frugalmechanic.com/snapshots" I don't use this feature so its very likely that it could be broken. |
After working on a clean repro, I found that the x.+ syntax works (yay! 🎉) but that other forms, such as latest.integration or latest.release don't (which are really what I need). (You can see a full list of them here: https://ant.apache.org/ivy/history/latest-milestone/ivyfile/dependency.html#revision) Do you still have enough context to try taking a look and see if there might be an easy fix for this? Thanks again! |
I tried using dynamic revisions (http://ant.apache.org/ivy/history/2.3.0/ivyfile/dependency.html#revision) like this:
resolvers += "myOrganization" at "s3://repo.myOrganization.s3-us-west-2.amazonaws.com/releases"
libraryDependencies ++= Seq(
"myOrganization" % "foo" % "1.0.+",
)
This is the result I see:
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: myOrganization#foo;1.0.+: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: unresolved dependency: myOrganization#foo;1.0.+: not found
I'm trying to use dynamic versions because I publish artifacts with this form: majorVersion.minorVersion.buildNumber-gitCommitId
My best guess (from reading the source code) is that getObjectMetadata returns a 404 in getURLInfo when SBT/Ivy is scanning for candidates. If this isn't something you have the time or interest to support, would you be open to a pull request?
The text was updated successfully, but these errors were encountered: