45

I've pushed my artifact to oss nexus repo, added it as dependency to another project. Idea keeps me warning:

[warn] Unable to reparse com.github.kondaurovdev#jsonapi_2.11;0.1-SNAPSHOT from sonatype-snapshots, using Fri May 13 17:12:52 MSK 2016 [warn] Choosing sonatype-snapshots for com.github.kondaurovdev#jsonapi_2.11;0.1-SNAPSHOT 

Maybe i pushed artifact somehow in a wrong way? But i did it earlier, everything was ok. How to get rid of these warnings? Or just ignore them?

Alexander Kondaurov
  • 3,677
  • 5
  • 42
  • 64
  • 2
    I made a basic 3 line build.sbt that reproduces the problem: resolvers += Resolver.sonatypeRepo("snapshots") libraryDependencies += "org.postgresql" % "postgresql" % "9.4.1209-SNAPSHOT" Then run `sbt update` – kshakir May 27 '16 at 15:11
  • 1
    I'm having the same issue. This message is displayed and the SNAPSHOT artifact from the remote repo is used, ignoring my locally published one. – giannoug May 30 '16 at 09:05
  • 2
    FYI- I ran the build.sbt in 1.0.0-M4 with the same effect. I can't tell via [github](https://github.com/sbt/sbt/blame/v0.13.11/ivy/src/main/scala/sbt/ivyint/SbtChainResolver.scala#L225-L240) [source](https://github.com/sbt/librarymanagement/blame/v0.1.0-M11/librarymanagement/src/main/scala/sbt/internal/librarymanagement/ivyint/SbtChainResolver.scala#L228-L243) if the warning is a bug or feature. (Side note: I got further than http://stackoverflow.com/q/37126026/3320205 with `addMavenResolverPlugin`, but ran into a "Failed to read artifact descriptor".) Perhaps sbt-dev may need to be pinged? – kshakir Jun 02 '16 at 02:54
  • 3
    anybody got any news on this? Running into the same problem... – Bjarne77 Aug 16 '16 at 08:16

2 Answers2

21

I had the same issue.

Did you publish your SNAPSHOT version to your artifactory? If so this might be your problem.

As you know when publishing locally your snapshot version is stored in the .ivy2/local directory. The remote version are stored in the .ivy2/cache directory.

When looking into the .ivy2/cache/{dependency} folder you will see that it has only downloaded the xml and properties file. So just the metadata and no jars. This is the actual reason why it can't be parsed since it's not there.

Since the .ivy2/cache takes precedence over .ivy2/local it won't see your local published version. There are 2 ways to fix this.

  • Update your snapshot version number(recommended)
  • Remove the SNAPSHOT from your artifactory and remove the .ivy2/cache/{dependency} folder on every client that has a local version.

In my opinion the first one is the way to go.

raam86
  • 6,785
  • 2
  • 31
  • 46
Jork
  • 466
  • 4
  • 13
  • 2
    I even had a second issue which also caused the same error. I had the same library but an older version in the unmanagedBase directory. Deleting this old version from the directory would be the fix – Jork Aug 31 '16 at 10:15
  • Thank you for the answer, What do you mean update your snapshot version? publishing locally again doesn't solve this.. – raam86 Feb 14 '17 at 10:44
  • @raam86 I meant updating the version number. So in effect publishing a new version – Jork Feb 15 '17 at 10:58
  • 2
    Why one would not be allowed to publish many snapshot with the same version and different timestamp? is it wrong for some reason ? – Edmondo Sep 08 '17 at 11:46
9

I had the same issue, and it goes away after I add the follow in my build.sbt:

updateOptions := updateOptions.value.withLatestSnapshots(false)

You can find more detail from https://github.com/sbt/sbt/issues/2650

vsftam
  • 145
  • 1
  • 7