Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load.ivy fails to resolve transitive dependencies for locally published artifacts #300

holgerbrandl opened this issue Dec 11, 2015 · 4 comments


Copy link

@holgerbrandl holgerbrandl commented Dec 11, 2015

Using the latest 0.5.1 amm, dependency resolution for locally deployed artifacts does not seem to resolve sub-dependcies. Here's a SSCE

## clean up cache and previoulsy deployed versions of our artifact and also the ammonite cache
rm -rf  ~/.ivy2/cache/de.mpicbg.scicomp/ ~/.ivy2/local/de.mpicbg.scicomp/ ~/.ammonite/cache
git clone
cd scalautils
sbt publishLocal

## start ammonite shell

## load scalautils dependency
load.ivy("de.mpicbg.scicomp" %% "scalautils" % "0.1-SNAPSHOT")

## load a class from a transitive dependency
import better.files.File

And this is a run protocol

Desktop]$ rm -rf  ~/.ivy2/cache/de.mpicbg.scicomp/ ~/.ivy2/local/de.mpicbg.scicomp/ ~/.ammonite/cache
[Desktop]$ git clone
Cloning into 'scalautils'...
remote: Counting objects: 600, done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 600 (delta 6), reused 0 (delta 0), pack-reused 570
Receiving objects: 100% (600/600), 249.86 KiB | 0 bytes/s, done.
Resolving deltas: 100% (240/240), done.
Checking connectivity... done.
[Desktop]$ cd scalautils
[scalautils]$ sbt publishLocal
[info] Loading project definition from /Users/brandl/Desktop/scalautils/project
[info] Updating {file:/Users/brandl/Desktop/scalautils/project/}scalautils-build...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Set current project to scalautils (in build file:/Users/brandl/Desktop/scalautils/)
[info] Updating {file:/Users/brandl/Desktop/scalautils/}scalautils...
[info] Packaging /Users/brandl/Desktop/scalautils/target/scala-2.11/scalautils_2.11-0.1-SNAPSHOT-sources.jar ...
[info] Done packaging.
[info] Wrote /Users/brandl/Desktop/scalautils/target/scala-2.11/scalautils_2.11-0.1-SNAPSHOT.pom
[info] Resolving jline#jline;2.12.1 ...
[info] Done updating.
[info] :: delivering :: de.mpicbg.scicomp#scalautils_2.11;0.1-SNAPSHOT :: 0.1-SNAPSHOT :: integration :: Fri Dec 11 11:16:14 CET 2015
[info]  delivering ivy file to /Users/brandl/Desktop/scalautils/target/scala-2.11/ivy-0.1-SNAPSHOT.xml
[info] Main Scala API documentation to /Users/brandl/Desktop/scalautils/target/scala-2.11/api...
[info] Compiling 13 Scala sources to /Users/brandl/Desktop/scalautils/target/scala-2.11/classes...
model contains 33 documentable templates
[info] Main Scala API documentation successful.
[info] Packaging /Users/brandl/Desktop/scalautils/target/scala-2.11/scalautils_2.11-0.1-SNAPSHOT-javadoc.jar ...
[info] Done packaging.
[info] Packaging /Users/brandl/Desktop/scalautils/target/scala-2.11/scalautils_2.11-0.1-SNAPSHOT.jar ...
[info] Done packaging.
[info]  published scalautils_2.11 to /Users/brandl/.ivy2/local/de.mpicbg.scicomp/scalautils_2.11/0.1-SNAPSHOT/poms/scalautils_2.11.pom
[info]  published scalautils_2.11 to /Users/brandl/.ivy2/local/de.mpicbg.scicomp/scalautils_2.11/0.1-SNAPSHOT/jars/scalautils_2.11.jar
[info]  published scalautils_2.11 to /Users/brandl/.ivy2/local/de.mpicbg.scicomp/scalautils_2.11/0.1-SNAPSHOT/srcs/scalautils_2.11-sources.jar
[info]  published scalautils_2.11 to /Users/brandl/.ivy2/local/de.mpicbg.scicomp/scalautils_2.11/0.1-SNAPSHOT/docs/scalautils_2.11-javadoc.jar
[info]  published ivy to /Users/brandl/.ivy2/local/de.mpicbg.scicomp/scalautils_2.11/0.1-SNAPSHOT/ivys/ivy.xml
[success] Total time: 24 s, completed Dec 11, 2015 11:16:37 AM
[scalautils]$ amm
Welcome to the Ammonite Repl 0.5.1
(Scala 2.11.7 Java 1.8.0_65)
@ load.ivy("de.mpicbg.scicomp" %% "scalautils" % "0.1-SNAPSHOT")
:: loading settings :: url = jar:file:/Users/brandl/bin/amm!/org/apache/ivy/core/settings/ivysettings.xml
:: resolving dependencies :: de.mpicbg.scicomp#scalautils_2.11-caller;working
    confs: [default]
    found de.mpicbg.scicomp#scalautils_2.11;0.1-SNAPSHOT in local
downloading /Users/brandl/.ivy2/local/de.mpicbg.scicomp/scalautils_2.11/0.1-SNAPSHOT/jars/scalautils_2.11.jar ...
    [SUCCESSFUL ] de.mpicbg.scicomp#scalautils_2.11;0.1-SNAPSHOT!scalautils_2.11.jar (7ms)

@ import better.files.File
Compilation Failed
Main.scala:33: not found: value better
import better.files.File

I've tried 3 machines (macos, ubuntu, centos) and it's always shows the same error pattern.

@holgerbrandl holgerbrandl changed the title load.ivy fails to resolve pom load.ivy fails to resolve transitive dependencies for locally published artifacts Dec 11, 2015
@lihaoyi lihaoyi added the bug label Dec 13, 2015
Copy link

@gorzell gorzell commented Dec 18, 2015

It seems that this is not only an issue with items that were published locally, but occurs with anything that has ever been cached. The following gist has examples with the caches in various states. The only cases that work are the ones in which there is nothing in the ivy cache.

Copy link

@mlangc mlangc commented Nov 25, 2016

Is there a workaround? This still hits me with 0.8.0...

Copy link

@lihaoyi lihaoyi commented May 18, 2017

I guess it was fixed by #395? I can't reproduce the original links, which were running on an ancient version 0.5.1.

@lihaoyi lihaoyi closed this May 18, 2017
Copy link

@lihaoyi lihaoyi commented May 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants