Question

With dependency management tools like rvm, dart's pub, etc, you can specify a dependency without a specific version. I will get the latest versions of each dependency an produce a baseline artifact. This artifact contains each dependency with their latest version at the time you ran the command.

With sbt I find myself doing this step manually by looking at the maven repo. Is their a sbt plugin that does that already ?

For exemple with dart's pub you can do this.

pubspec.yaml

...
dependencies:
  args: '>=0.10.0 < 0.11.0'
  analyzer: '>=0.13.0 <0.14.0'
  barback: '>=0.11.1 <0.14.0'
...

pubspec.lock

packages:
  analyzer:
    description: analyzer
    source: hosted
    version: "0.13.6"
  args:
    description: args
    source: hosted
    version: "0.10.0+2"
  barback:
    description: barback
    source: hosted
    version: "0.12.0"
...
Was it helpful?

Solution 2

Building on the answer from @darko-cerdic

You can specify latest as a revision number. Eg:

libraryDependencies += "org.apache.derby" % "derby" % "latest.release"

For more details check out ivy documentation:

http://ant.apache.org/ivy/history/2.3.0/ivyfile/dependency.html#revision

If you want, you can manually specify dependencyOverrides to force a specific library version:

dependencyOverrides ++= Seq( "org.apache.derby" % "derby" % "1.0.0")

Note that in SBT 1.+ the dependencyOverrides are specified as a Seq, whereas in prior versions it was specified as a Set.

Using the sbt-lock plugin, you can lock the current version for all of your dependencies, so that your CI system can use a stable set of dependencies. It generates a set of dependencyOverrides based on the current set of resolved libraryDependencies. This gives you behavior that is similar to a Gemfile.lock.

https://github.com/tkawachi/sbt-lock

OTHER TIPS

You can specify latest as a revision number. Eg:

libraryDependencies += "org.apache.derby" % "derby" % "latest.release"

For more details check out ivy documentation:

http://ant.apache.org/ivy/history/2.3.0/ivyfile/dependency.html#revision

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top