Is there a command in the SBT console that forces it to resolve artifacts (especially, re-resolve SNAPSHOT dependencies)? The only way I know of now is to run clean and then compile (or start), but this takes much longer and isn't always necessary.
Background. update resolves dependencies according to the settings in a build file, such as libraryDependencies and resolvers . Other tasks use the output of update (an UpdateReport ) to form various classpaths. Tasks that in turn use these classpaths, such as compile or run , thus indirectly depend on update .
If you have JAR files (unmanaged dependencies) that you want to use in your project, simply copy them to the lib folder in the root directory of your SBT project, and SBT will find them automatically.
By default, sbt uses the standard Ivy home directory location ${user.
You can use Pretty Clean to clean the all of dev tools caches including SBT. PrettyClean also cleans the SBT project's target folder.
You can mark the needed dependencies to re-check them on update
:
libraryDependencies ++= {
"org.specs2" %% "specs2" % "1.10-SNAPSHOT" % "test" changing()
}
Re-download a SNAPSHOT version of a dependency using SBT
The update
command should help.
From the task's documentation:
Resolves and optionally retrieves dependencies, producing a report.
See Dependency Management Flow.
What's more important, SNAPSHOT
dependencies are in their nature changing()
so there's no need to add anything after ModuleID to mark them as such. Every update
is supposed to resolve them against the repositories.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With