question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fail to download the first SNAPSHOT publish to Artifactory

See original GitHub issue

In trying to figure out #1750 I’ve hit this snag. Asides from it getting in the way, I wonder if it’s indicative of anything, such as my setting up wrong.

steps

  1. Setup:
sbt.version=0.13.8

Dependency project, sbt-gh1750-bippy:

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

val localRelease  = "local-release"  at "http://localhost:8081/artifactory/libs-release-local"
val localSnapshot = "local-snapshot" at "http://localhost:8081/artifactory/libs-snapshot-local"

publishTo := Some(if (isSnapshot.value) localSnapshot else localRelease)
credentials := Seq(Credentials("Artifactory Realm", "localhost", "admin", "password"))

Dependee project, sbt-gh1750-myapp:

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

val localRelease  = "local-release"  at "http://localhost:8081/artifactory/libs-release-local"
val localSnapshot = "local-snapshot" at "http://localhost:8081/artifactory/libs-snapshot-local"

resolvers += localSnapshot

libraryDependencies += "com.dwijnand" %% "sbt-gh1750-bippy" % "0.1.0-SNAPSHOT"
  1. In sbt-gh1750-bippy, publish
  2. In sbt-gh1750-myapp, reload and update

problem

update outputs:

[info] Updating {file:/Users/dnw/Desktop/sbt-gh1750-myapp/}sbt-gh1750-myapp...
[info] Resolving jline#jline;2.12.1 ...
[warn]  [NOT FOUND  ] com.dwijnand#sbt-gh1750-bippy_2.11;0.1.0-SNAPSHOT!sbt-gh1750-bippy_2.11.jar (4ms)
[warn] ==== local-snapshot: tried
[warn]   http://localhost:8081/artifactory/libs-snapshot-local/com/dwijnand/sbt-gh1750-bippy_2.11/0.1.0-SNAPSHOT/sbt-gh1750-bippy_2.11-0.1.0-20150706.083249-1.jar
[warn]   http://localhost:8081/artifactory/libs-snapshot-local/com/dwijnand/sbt-gh1750-bippy_2.11/0.1.0-SNAPSHOT/sbt-gh1750-bippy_2.11-0.1.0-SNAPSHOT.jar
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::              FAILED DOWNLOADS            ::
[warn]  :: ^ see resolution messages for details  ^ ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.dwijnand#sbt-gh1750-bippy_2.11;0.1.0-SNAPSHOT!sbt-gh1750-bippy_2.11.jar
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) sbt.ResolveException: download failed: com.dwijnand#sbt-gh1750-bippy_2.11;0.1.0-SNAPSHOT!sbt-gh1750-bippy_2.11.jar
[error] Total time: 1 s, completed 06-Jul-2015 09:34:48

expectation

No error, downloads the published snapshot on update.

note

It feels to me like it’s related to the fact that http://localhost:8081/artifactory/libs-snapshot-local/com/dwijnand/sbt-gh1750-bippy_2.11/0.1.0-SNAPSHOT/ shows:

maven-metadata.xml                                              06-Jul-2015 09:32  1.17 KB
maven-metadata.xml.md5                                          06-Jul-2015 09:32  32 bytes
maven-metadata.xml.sha1                                         06-Jul-2015 09:32  40 bytes
sbt-gh1750-bippy_2.11-0.1.0-20150706.083249-1-javadoc.jar       06-Jul-2015 09:32  340.70 KB
sbt-gh1750-bippy_2.11-0.1.0-20150706.083249-1-javadoc.jar.md5   06-Jul-2015 09:32  32 bytes
sbt-gh1750-bippy_2.11-0.1.0-20150706.083249-1-javadoc.jar.sha1  06-Jul-2015 09:32  40 bytes
sbt-gh1750-bippy_2.11-0.1.0-20150706.083249-1-sources.jar       06-Jul-2015 09:32  438 bytes
sbt-gh1750-bippy_2.11-0.1.0-20150706.083249-1-sources.jar.md5   06-Jul-2015 09:32  32 bytes
sbt-gh1750-bippy_2.11-0.1.0-20150706.083249-1-sources.jar.sha1  06-Jul-2015 09:32  40 bytes
sbt-gh1750-bippy_2.11-0.1.0-20150706.083249-1.pom               06-Jul-2015 09:32  821 bytes
sbt-gh1750-bippy_2.11-0.1.0-20150706.083249-1.pom.md5           06-Jul-2015 09:32  32 bytes
sbt-gh1750-bippy_2.11-0.1.0-20150706.083249-1.pom.sha1          06-Jul-2015 09:32  40 bytes
sbt-gh1750-bippy_2.11-0.1.0-20150706.083249-2.jar               06-Jul-2015 09:32  1.46 KB
sbt-gh1750-bippy_2.11-0.1.0-20150706.083249-2.jar.md5           06-Jul-2015 09:32  32 bytes
sbt-gh1750-bippy_2.11-0.1.0-20150706.083249-2.jar.sha1          06-Jul-2015 09:32  40 bytes

Note that the jar is -2.jar rather than -1.jar.

Re-publishing bippy “solves” this, but it’s not ideal.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:24 (18 by maintainers)

github_iconTop GitHub Comments

3reactions
dwijnandcommented, Nov 17, 2016

@MansurAshraf The solution is to add a defined build.timestamp your snapshot repository URL:

def buildTimestampSuffix = ";build.timestamp=" + new java.util.Date().getTime

def localArtifactorySnapshotLocal =
  "local-artifactory-snapshot-local" at
    "http://localhost:8081/artifactory/libs-snapshot-local" + buildTimestampSuffix
2reactions
oeuftetecommented, Oct 10, 2018

For those people for whom https://github.com/sbt/sbt/issues/2088#issuecomment-261134192 doesn’t work, https://stackoverflow.com/a/23585401/7674 may be your solution, configuring the Artifactory repository to use non-unique snapshots.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to deploy SNAPSHOT for first time nonunique to unique
When i run the test of deploying a pom with <uniqueVersion>false</uniqueVersion> to a repository set with Snapshot Version Behavior - UNIQUE
Read more >
Failed to resolve artifact (snapshot) from my artifactory repository
Show activity on this post. For some reason my local maven repository was dirty (no snapshot timestamps in metadata file downloaded).
Read more >
562847 – Deploy to JFrog Artifactory fails with 401 - Bugs
I upgraded from SimRel 2019-06 with m2e version 1.12.0. Now I receive fail in deploy commands with unauthorized access, but it is not...
Read more >
IntelliJ gets errors when trying to download artifacts from ...
Any ideas on why the following error happens? If I see a red underline for an JAR that didn't download, I search in...
Read more >
Cannot deploy to Jenkins Artifactory - Google Groups
I'm trying to deploy snapshots of my plugin ... -ci.org/snapshots/org/jenkins-ci/plugins/rocketchatnotifier/0.2.2-SNAPSHOT/maven-metadata.xml Downloaded: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found