Skip to content

Fix SNAPSHOT srcs/docs with Ivy upgrade.#2163

Merged
jsuereth merged 3 commits intosbt:0.13from
dwijnand:fix/1750
Aug 27, 2015
Merged

Fix SNAPSHOT srcs/docs with Ivy upgrade.#2163
jsuereth merged 3 commits intosbt:0.13from
dwijnand:fix/1750

Conversation

@dwijnand
Copy link
Member

Fixes #1750.


Updates to the fixes in sbt/ivy#17.

I realise this is missing some due diligence regression suite tests and notes,
but I wanted to push this out for feedback.

@typesafe-tools
Copy link

Can one of the admins verify this patch?

@dwijnand
Copy link
Member Author

Copied from sbt/ivy#15, this is how I've been reproducing this bug:

  • Stock Nexus installed with homebrew
  • sbt-gh1750-bippy, the SNAPSHOT dependency
  • sbt-gh1750-myapp, the project trying to get updated SNAPSHOT sources
  • Change bippy, and publish to Nexus
  • Run updateClassifiers in myapp, see if it downloads the sources jar
  • As a second test, check the contents bippy:
unzip -c ~/.ivy2/cache/com.dwijnand/sbt-gh1750-bippy_2.11/srcs/sbt-gh1750-bippy_2.11-0.1.0-SNAPSHOT-sources.jar Bippy.scala
// sbt-gh1750-bippy/build.sbt

organization := "com.dwijnand"
        name := "sbt-gh1750-bippy"
     version := "0.1.0-SNAPSHOT"
scalaVersion := "2.11.7"

val localNexusReleases  = "local-nexus-releases"  at "http://localhost:8081/nexus/content/repositories/releases"
val localNexusSnapshots = "local-nexus-snapshots" at "http://localhost:8081/nexus/content/repositories/snapshots"
val localNexusCreds = Credentials("Sonatype Nexus Repository Manager", "localhost", "admin", "admin123")

publishTo := Some(if (isSnapshot.value) localNexusSnapshots else localNexusReleases)
credentials := Seq(localNexusCreds)
// sbt-gh1750-myapp/build.sbt
organization := "com.dwijnand"
        name := "sbt-gh1750-myapp"
     version := "0.1.0-SNAPSHOT"
scalaVersion := "2.11.7"

val localNexusReleases  = "local-nexus-releases"  at "http://localhost:8081/nexus/content/repositories/releases"
val localNexusSnapshots = "local-nexus-snapshots" at "http://localhost:8081/nexus/content/repositories/snapshots"

resolvers += localNexusReleases
resolvers += localNexusSnapshots

libraryDependencies += "com.dwijnand" %% "sbt-gh1750-bippy" % "0.1.0-SNAPSHOT"

@dwijnand
Copy link
Member Author

Travis failed because sbt/ivy#17 hasn't been released (or merged) yet.

@dwijnand
Copy link
Member Author

Rebased and force pushed.

Added a scripted test, which prior to the Ivy update fails and after passes(!).

However, as mentioned on Gitter, I needed a way to declare a local filesystem resolver that actually copied files out to the Ivy cache, instead of just using the file in place, so I could verify against what was resolved/downloaded.

So I've made a change to MavenRepository to allow for that. I've simulated and tested in a separated repo with MiMa that these are the changes necessary for bincompat, but please have a look.

I'm not sure if that flag needs notes. Also potentially I could split that change out of this pull request.

Still haven't written up notes for the fix itself; what do you think of it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure about the name. I went with the prior art of the repo here.

@eed3si9n
Copy link
Member

Commented on dwijnand/sbt@24495be

@dwijnand dwijnand self-assigned this Aug 21, 2015
@dwijnand
Copy link
Member Author

@eed3si9n I've added another commit as there was a failure in Travis that I'm not sure if it was legitimate or not.

What do you think of dwijnand@467e9ab? Note I added a comment below it as well.

Other than that, what do you think of this PR, the fix itself etc?

@dwijnand
Copy link
Member Author

Hmm yeah... looks like my test doesn't work on Travis:

Failed to read jar /tmp/sbt_8f770495/update-classifiers-snapshot-srcs/target/ivy/cache/org.example/bippy_2.11/srcs/bippy_2.11-1.0-SNAPSHOT-sources.jar

Don't understand why though :-/

@dwijnand
Copy link
Member Author

Travis is failing when using mavenResolverPlugin. I have a local change that fixes the pathing to sources jar, but running that test shows that the issue is still present when using that plugin.. :(

Currently fails with:
    [info] java.lang.AssertionError: assertion failed: Bippy should contain def release = 2, contents:
    [info] package t
    [info]
    [info] object Bippy {
    [info]   def release = 1
    [info] }

Also fails with MavenResolverPlugin.. :(
@dwijnand
Copy link
Member Author

Travis passed! :)

@jsuereth
Copy link
Member

LGTM

jsuereth added a commit that referenced this pull request Aug 27, 2015
Fix SNAPSHOT srcs/docs with Ivy upgrade.
@jsuereth jsuereth merged commit f6895b6 into sbt:0.13 Aug 27, 2015
@dwijnand
Copy link
Member Author

Uh... I was going to make the change discussed in sbt/ivy#17 and the relevant sbt changes here to enable the ivySettings flag..

I'll open a new PR in both repos with that change.

@dwijnand
Copy link
Member Author

Also this was missing notes, so that'll be part of the follow up PR.

@dwijnand dwijnand removed their assignment Jan 13, 2017
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.

4 participants