Skip to content

Fixes #1514, #321. Fixes -SNAPSHOT issue by re-implemeting ChainResolver#1520

Merged
jsuereth merged 5 commits into0.13from
fix/1514
Aug 12, 2014
Merged

Fixes #1514, #321. Fixes -SNAPSHOT issue by re-implemeting ChainResolver#1520
jsuereth merged 5 commits into0.13from
fix/1514

Conversation

@eed3si9n
Copy link
Member

Fixes #1514, #321

Adds lastestSnapshots flag to updateOptions, which controls the behavior of the chained resolver. Up until 0.13.6, sbt was picking the first -SNAPSHOT revision it found along the chain. When lastestSnapshots is enabled (default: true), it will look into all resolvers on the chain, and compare them using the publish date.
The tradeoff is probably a longer resolution time if you have many remote repositories on the build or you live away from the severs. So here's how to disable it:

updateOptions := updateOptions.value.withLatestSnapshots(false)

Ivy by default uses latest-revision as the latest strategy. This strategy I don't think takes in account for the possibility that a changing revision may exist in multiple repositories/resolvers with having identical version number like 0.1.0-SNAPSHOT.
The implementation is a bit hacky, but I think it attacks the core of this problem.

…ue. #1514

* Create a project "common" which publishes a "bad" artifact.
* Resolve project "dependent" which resolves the "bad" artifact into the cache.
* Publish a new "common" snapshot to a diffferent repository (publishLocal)
* Attempt to build the new project, leading to issues.
…ver.

Adds `lastestSnapshots` flag to `updateOptions`, which controls the behavior of the chained resolver. Up until 0.13.6, sbt was picking the first `-SNAPSHOT` revision it found along the chain. When  is enabled (default: ), it will look into all resolvers on the chain, and compare them using the publish date.
The tradeoff is probably a longer resolution time if you have many remote repositories on the build or you live away from the severs. So here's how to disable it:

    updateOptions := updateOptions.value.withLatestSnapshots(false)

Ivy by default uses latest-revision as the latest strategy. This strategy I don't think takes in account for the possibility that a changing revision may exist in multiple repositories/resolvers with having identical version number like 0.1.0-SNAPSHOT.
The implementation is a bit hacky, but I think it attacks the core of this problem.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the filter? What else could be in there?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ivy doesn't use Java 5 generics, so we get like Collection all the time.

@jsuereth
Copy link
Member

LGTM!!!!

jsuereth added a commit that referenced this pull request Aug 12, 2014
Fixes #1514, #321. Fixes -SNAPSHOT issue by re-implemeting ChainResolver
@jsuereth jsuereth merged commit 58175e2 into 0.13 Aug 12, 2014
@jsuereth jsuereth deleted the fix/1514 branch August 12, 2014 14:04
eed3si9n added a commit that referenced this pull request Jun 25, 2015
Reinstate SNAPSHOT test that was fixed in #1520/#1514
eed3si9n added a commit that referenced this pull request Dec 14, 2015
#1520 originally fixed #1514 by reimplementing part of chain resolver
to check all resolvers to find the latest snapshot artifacts.
This behavior did not work well with Maven repositories where sbt was
failing to calculate the correct publication dates.
Now that #2075 fixes the Maven integration issue we should enable this
flag back again.

The build user can opt out by:

    updateOptions := updateOptions.value.withLatestSnapshots(false)
jvican pushed a commit to scalacenter/sbt that referenced this pull request May 23, 2017
Fixes sbt#1514, sbt#321. Fixes -SNAPSHOT issue by re-implemeting ChainResolver
adpi2 pushed a commit to adpi2/sbt that referenced this pull request Oct 9, 2024
Fixes sbt#1514, sbt#321. Fixes -SNAPSHOT issue by re-implemeting ChainResolver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants