com-lihaoyi / Ammonite

Scala Scripting
http://ammonite.io
MIT License
2.61k stars 372 forks source link

Locally Published Package Fails to Download Dependency #1094

Closed FA5I closed 3 years ago

FA5I commented 4 years ago

Hi,

I am working on a package that works with the Almond.sh kernel. My files are as follows:

build.sbt:

name := "example"

version := "0.1"

scalaVersion := "2.13.2"

// almond jupyter api
//resolvers += "jvm-repr" at "https://maven.imagej.net/content/repositories/public/"
libraryDependencies += "com.github.jupyter" % "jvm-repr" % "0.4.0" from "https://maven.imagej.net/content/repositories/public/com/github/jupyter/jvm-repr/0.4.0/jvm-repr-0.4.0.pom"
libraryDependencies += "sh.almond" %% "jupyter-api" % "0.9.1"

Example.scala:

import almond.interpreter.api.{DisplayData, OutputHandler}

object Example extends App {
    def f1() = {
      DisplayData(
        Map(
          // if we set up an extension for application/myapp+json, first element should be picked
          "application/myapp+json" -> """{"a": "A"}""",
          // else, text/html should be displayed
          "text/html" -> "<b>A</b>"
        )
      )
    }

    println(f1())
}

If I type:

publishLocal

in the SBT shell, it all compiles and publishes. However, if I import this into the Almond shell, I get the following issue:

Screenshot 2020-06-14 at 22 43 37

So it seems that it's failing to download the non-Maven repo for some reason as the added resolvers are being ignored. Could someone please explain how this can be fixed?

sake92 commented 3 years ago

@FA5I try to add the repo in ammonite also:

interp.repositories() ++= Seq(
  MavenRepository.of("https://maven.imagej.net/content/repositories/public")
)
FA5I commented 3 years ago

Thanks @sake92