30

I have the following lines in my build.sbt file.

resolvers += "specs2 snapshot repo" at "http://scala-tools.org/repo-snapshots"

libraryDependencies += "org.specs2" %% "specs2" % "1.7-SNAPSHOT" % "test"

Now if the snapshot has changed (is this reasonable at all, that a maven SNAPSHOT version changes without its version number changing?), how can I tell sbt to download the new version? Using update does nothing.

ziggystar
  • 28,410
  • 9
  • 72
  • 124

1 Answers1

56

you should try :

libraryDependencies += "org.specs2" %% "specs2" % "1.7-SNAPSHOT" % "test" changing()

changing() will specify that the dependency can change and that it ivy must download it on each update.

Maybe you could also try to define your repository using ivyXML. Something like this :

ivyXML :=
  <resolvers>
        <ibiblio name="specs2 snapshot repo" changingPattern="*-SNAPSHOT" m2compatible="true" root="http://scala-tools.org/repo-snapshots"/>
  </resolvers>

Hope this will help.

David
  • 2,399
  • 20
  • 17
  • 2
    I expected that this option doesn't have to be specified but can be infered from the *SNAPSHOT* string. Will sbt/ivy only check the checksums and don't download again if the jar has not changed? – ziggystar Nov 22 '11 at 12:16
  • Ivy defines a `matchingPattern` that you can use when defining a resolver. This `matchingPattern` gives you the ability to define a pattern (for example `"*-SNAPSHOT"`) for artefacts that will eventually change over the time. You should try to define a resolver with this attribute using `ivyXML` setting, maybe SBT will consider it. – David Nov 22 '11 at 12:54
  • 9
    In 0.12.1 at least, you don't need to specify changing: http://www.scala-sbt.org/release/docs/Detailed-Topics/Dependency-Management-Flow.html the last line: "There is no need to mark SNAPSHOT dependencies as changing() because sbt configures Ivy to know this already." – James Moore Nov 23 '12 at 18:43
  • Does specifying a wildcard directly in the Ivy spec work? `"org.specs2" %% "specs2" % "*-SNAPSHOT" % "test"` – Brent Faust Jun 17 '13 at 01:23